15.11.2016, 14:45
hey guys i have this dialog that wont give me the message "you can't add you in your friend list" but it give's me the message "that id isn't connected , please ad someone online"
the line who should give me the message if i try to ad me
why?
the line who should give me the message if i try to ad me
Код HTML:
if(i == playerid) return SendClientMessage(playerid, COLOR_WHITE, "Nu te poti adauga pe tine insuti.");
Код HTML:
if(dialogid == DIALOG_ADDFRIENDS) { if(response) { new text[50]; mysql_real_escape_string(inputtext, text); if(IsNumeric(text)) { new find = 0; foreach(Player, i) { if(IsPlayerConnected(i)) { if(find == 0) { new name[30],str1[256]; GetPlayerName(i, name, sizeof(name)); if(strfind(name, text) != -1) { find = 1; if(i == playerid) return SendClientMessage(playerid, COLOR_WHITE, "Nu te poti adauga pe tine insuti."); format(str1, sizeof(str1), "SELECT * FROM `friends` WHERE `FriendID`='%d' AND `PlayerID`='%d'",PlayerInfo[i][pSQLID],PlayerInfo[playerid][pSQLID]); new Cache: membresult = mysql_query(SQL,str1); if(cache_get_row_count () > 0) { SendClientMessage(playerid, COLOR_WHITE, "Acel jucator este deja in lista ta de prieteni."); return 1; } cache_delete(membresult); mysql_format(SQL, str1, sizeof(str1), "INSERT INTO `friends` (`PlayerID`,`FriendID`,`FriendName`) VALUES('%d','%d','%s')",PlayerInfo[playerid][pSQLID],PlayerInfo[i][pSQLID],PlayerInfo[i][pNormalName]); mysql_tquery(SQL,str1,"",""); SendClientMessage(playerid, COLOR_YELLOW, "Prieten adaugat!"); } } } else return SendClientMessage(playerid, COLOR_WHITE, "ID invalid. Poti adauga doar playerii care-s online in lista de prieteni."); } if(find == 0) { SendClientMessage(playerid, COLOR_WHITE, "ID invalid. Poti adauga doar playerii care-s online in lista de prieteni."); } } } }