SA-MP Forums

SA-MP Forums (https://forum.sa-mp.com/index.php)
-   Help Archive (https://forum.sa-mp.com/forumdisplay.php?f=89)
-   -   AntiCheat Kicking Innocent Players (https://forum.sa-mp.com/showthread.php?t=199295)

[WF]Demon 15/12/2010 03:52 AM

AntiCheat Kicking Innocent Players
 
Hello, i have coded a simple weapon anti-cheat, my admins and players on connect sometimes get kicked when they are innocent, im wondering if its my code or if sa-mp goes thru the weapons on connect (as in it gives the player 1 weapon takes it away and so on), my code is
pawn Code:
public WeaponCheck()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(GetPlayerWeapon(i) == 4 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Knife)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 9 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (ChainSaw)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 16 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Gernades)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 17 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (TearGas)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 18 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Motolov Cocktails)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 35 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Rocket Launcher)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 36 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (HS Rocket Launcher)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 37 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (FlameThrower)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 38 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Minigun)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 39 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Satchel)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 40 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Satchel Detonator)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 41 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (SprayCan)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 42 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Fire Extinguisher)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 42 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Fire Extinguisher)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 44 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Nightvision Goggles)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
else if(GetPlayerWeapon(i) == 45 && Admin[i] <= 1 && GetPlayerVirtualWorld(i) == 0)
{
ResetPlayerWeapons(i);
GetPlayerName(i,cmdname,sizeof(cmdname));
format(string3, sizeof(string3), "[AntiCheat]: %s Has Been Kicked For Weapon Hacks! (Thermal Goggles)", cmdname);
SendClientMessageToAll(red, string3);
Kick(i);
}
}
return 1;
}

Thanks

- [FF]Cody_Beer

XePloiT 15/12/2010 04:12 AM

Re: AntiCheat Kicking Innocent Players
 
check if anywhere in your server player can get any of those weapons...


All times are GMT. The time now is 06:09 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.