SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 15/12/2010, 03:52 AM   #1
[WF]Demon
Huge Clucker
 
[WF]Demon's Avatar
 
Join Date: Oct 2009
Posts: 484
Reputation: 3
Default 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
[WF]Demon is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[LOCK] Banning innocent people! MastahServers Help Archive 17 20/05/2010 03:45 PM
Ping Kicking BP13 Server Support 3 21/03/2010 03:27 PM
Kicking with YSI KnooL Help Archive 16 09/12/2009 05:41 AM


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


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