16.12.2011, 18:03
Hi all, I have "fast" question, I scripted this simple weapon anitcheat,
It works, but, the next player who joins the server with ID of banned player get banned to, Im not sure why..
There is few ways to solve this, for example this simple code << if(Spawned[i] == 0) return 1;>> this check if player is spawned, if not it wont be banned. Im not sure what is wrong with this..?
Quote:
public anticheat() { for(new i = 0; i < MAX_PLAYERS; i++) { if(GetPlayerWeapon(i) == 36 || GetPlayerWeapon(i) == 37) { new pname[MAX_PLAYER_NAME]; new string[124]; GetPlayerName(i, pname, sizeof(pname)); format(string, sizeof(string), " %s has been banned! Reason: Forbidden weapon", pname); SendClientMessageToAll(COLOR,string); BanEx(i,string); } } return 1; } |
There is few ways to solve this, for example this simple code << if(Spawned[i] == 0) return 1;>> this check if player is spawned, if not it wont be banned. Im not sure what is wrong with this..?