02.06.2018, 17:44
Hi guys
I use GetPlayerID function to check is player online
For example:
Function GetPlayerID
Player_Name function(uses in GetPlayerID function)
What is bug?
I'm make check to see is "Gospodin" online,but they will give positive result if "Gospodin_" "Gospodin_X" etc are online...But I need to check just if "Gospodin" is online,no other combination...
I use GetPlayerID function to check is player online
For example:
Код:
new id= GetPlayerID("Gospodin"); if(IsPlayerConnected(id)) { printf("Gospodin is online"); }
Код:
GetPlayerID(string[]) { for(new i = 0; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) == 1) { if(strcmp(Player_Name(i), string, true, strlen(string)) == 0) { return i; } } } return INVALID_PLAYER_ID; }
Код:
Player_Name(id) { new ime[MAX_PLAYER_NAME+1]; GetPlayerName(id, ime, sizeof ime); return ime; }
I'm make check to see is "Gospodin" online,but they will give positive result if "Gospodin_" "Gospodin_X" etc are online...But I need to check just if "Gospodin" is online,no other combination...