pawn Код:
At the top..:
forward anticheat(playerid);
In OnGameModeInit:
SetTimer("anticheat", 1000, 1); //So, the public anticheat() will be call every seconds, to prevent lags.
And at the end:
public anticheat(playerid)
{
new string[256], plname[64];
if(IsPlayerConnected(playerid))
{
if(GetPlayerWeapon(playerid) == 38)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "[SERVEUR]: [%s] а йtй banni par l'Anti-Cheat. [Raison]: Triche Arme (Minigun)", plname);
SendClientMessageToAll(COLOR_RED,string);
Ban(playerid);
}
}
if(GetPlayerWeapon(playerid) == 9)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "[SERVEUR]: [%s] а йtй banni par l'Anti-Cheat. [Raison]: Triche Arme (Tronзoneuse)", plname);
SendClientMessageToAll(COLOR_RED,string);
Ban(playerid);
}
}
if(GetPlayerWeapon(playerid) == 16)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "[SERVEUR]: [%s] а йtй banni par l'Anti-Cheat. [Raison]: Triche Arme (Grenade)", plname);
SendClientMessageToAll(COLOR_RED,string);
Ban(playerid);
}
}
if(GetPlayerWeapon(playerid) == 26)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "[SERVEUR]: [%s] а йtй banni par l'Anti-Cheat. [Raison]: Triche Arme (Shawn-off)", plname);
SendClientMessageToAll(COLOR_RED,string);
Ban(playerid);
}
}
if(GetPlayerWeapon(playerid) == 36)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "[SERVEUR]: [%s] а йtй banni par l'Anti-Cheat. [Raison]: Triche Arme (Lance Roquette automatique)", plname);
SendClientMessageToAll(COLOR_RED,string);
Ban(playerid);
}
}
if(GetPlayerWeapon(playerid) == 37)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "[SERVEUR]: [%s] а йtй banni par l'Anti-Cheat. [Raison]: Triche Arme (Lance-Flammes)", plname);
SendClientMessageToAll(COLOR_RED,string);
Ban(playerid);
}
}
if(GetPlayerWeapon(playerid) == 39)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "[SERVEUR]: [%s] а йtй banni par l'Anti-Cheat. [Raison]: Triche Arme (Charges explosives)", plname);
SendClientMessageToAll(COLOR_RED,string);
Ban(playerid);
}
}
if(GetPlayerWeapon(playerid) == 44 || GetPlayerWeapon(playerid) == 45)
{
if(PlayerInfo[playerid][pAdmin] >= 1)
{
return 1;
}
else
{
TogglePlayerControllable(playerid, 0);
GetPlayerName(playerid, plname, sizeof(plname));
format(string, sizeof(string), "[SERVEUR]: [%s] а йtй banni par l'Anti-Cheat. [Raison]: Triche Arme (Lunettes de vision nocturne)", plname);
SendClientMessageToAll(COLOR_RED,string);
Ban(playerid);
}
}
}
return 1;
}
This anti-cheat bug, when a player connect, it automaticly ban him, I really don't know why..
This code do absolutly nothing.. I don't know why..
Sreadon.
Ah, and if you have time, please check at this link.. :