stock ShowPlayerFriends(playerid) {
new
szDialog[1024],
szDialog2[1024],
szQuery[256],
szTitle[256],
szString[256],
x,
onf;
format(szQuery, sizeof(szQuery), "SELECT * FROM `friends` WHERE `AddBy` = '%d'", PlayerInfo[playerid][pSQLID]);
new Cache: result = mysql_query(SQL, szQuery);
for(new i, j = cache_get_row_count (); i != j; ++i)
{
cache_get_field_content(i, "friendName", szString);
format(Selected[playerid][x], MAX_PLAYER_NAME, szString);
{
onf++;
if(x == 0) format(szDialog, sizeof(szDialog), "Add Friend...\n{13E300}%s (%d){FFFFFF}\n", szString, userID);
else format(szDialog, sizeof(szDialog), "{13E300}%s (%d){FFFFFF}\n", szString, userID);
strcat(szDialog2, szDialog);
}
else
{
if(x == 0) format(szDialog, sizeof(szDialog), "Add Friend...\n{FF0000}%s{FFFFFF}\n", szString);
else format(szDialog, sizeof(szDialog), "{FF0000}%s{FFFFFF}\n", szString);
strcat(szDialog2, szDialog);
}
x++;
}
if(x == 0) {
format(szDialog, sizeof(szDialog), "Add Friend...");
strcat(szDialog2, szDialog);
}
cache_delete(result);
format(szTitle, sizeof(szTitle), "Online Friends: %d", onf);
ShowPlayerDialog(playerid, DIALOG_FRIENDS, DIALOG_STYLE_LIST, szTitle, szDialog2, "Select", "Back");
return 1;
}
mai exact, cred ca asta este problema:
new userID = GetPlayerID( szString );
if(userID != INVALID_PLAYER_ID)