31.07.2013, 08:08
Hello. I got a problem. At OnPlayerConnect, the server gets the player's name and stores the string in the variable 'Gpd', It now opens the file 'PK_List.txt' and searches for the string line-by-line. If the player's name exists in the file, it kicks the player. The problem I am having is that the server too kicks players which are not in the list. What to do?
pawn Код:
public OnPlayerConnect(playerid)
{
new Gpd[MAX_PLAYER_NAME], str[64];
GetPlayerName(playerid, Gpd, sizeof Gpd);
new File:wtf = fopen("PK_List.txt", io_read);
while(fread(wtf, Gpd))
{
if(strcmp(str, Gpd, true) == 0)
{
SendClientMessage(playerid, -1, "This player is killed in the war. This player cant be playable. Chage your name to something else.");
SetTimer("__Kick", 80, false);
}
}
fclose(wtf);
return 1;
}