Weapon Anti-Cheat failure - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Weapon Anti-Cheat failure (
/showthread.php?tid=350191)
Weapon Anti-Cheat failure -
Pizzy - 11.06.2012
I really think GetPlayerWeapon is screwed up, or very inaccurate.
It always thinks players which are only just connecting have miniguns.
pawn Код:
new reason = GetPlayerWeapon(i);
if(reason == 16||reason==35||reason==36||reason==37||reason==38 && IsPlayerConnected(i))
{
format(msg,sizeof(msg),"Weapon hacks (%s)", WeaponName(reason));
BanUser2(i, msg, anticheatname);
}
Does anyone know how to check if the player is .. i'm not sure, validly spawned. It bans them almost instantly after connecting.
Re: Weapon Anti-Cheat failure - HuSs3n - 11.06.2012
pawn Код:
public OnPlayerSpawn(playerid)
{
SetPVarInt(playerid,"Spawned",true);
}
public OnPlayerDeath(playerid,playerid,killerid,reason)
{
DeletePVar(playerid,"Spawned");
}
public OnPlayerUpdate(playerid)
{
if(GetPVarInt(playerid,"Spawned"))
{
new reason = GetPlayerWeapon(playerid);
if(reason == 16||reason==35||reason==36||reason==37||reason==38)
{
format(msg,sizeof(msg),"Weapon hacks (%s)", WeaponName(reason));
BanUser2(playerid, msg, anticheatname);
}
}
return 1;
}
im not sure if that will fix ur problem, but it check for weapons only if the player is spawned