Anti-WeaponHack - Problem - 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: Anti-WeaponHack - Problem (
/showthread.php?tid=425666)
Anti-WeaponHack - Problem -
Akcent_Voltaj - 26.03.2013
Sometimes when people connect to server.weapon hack kicks them(kicks innocent people).
Quote:
SetTimer("WeaponHack", 1000, 1);
|
Quote:
forward WeaponHack(playerid);
public WeaponHack(playerid)
{
for(new i; i < MAX_PLAYERS; i++)
{
new sendername[MAX_PLAYER_NAME];
GetPlayerName(i, sendername, sizeof(sendername));
new string[256];
if(GetPlayerWeapon(i) == 35 || GetPlayerWeapon(i) == 37 || GetPlayerWeapon(i) == 38 || GetPlayerWeapon(i) == 17)
{
format(string, sizeof(string), "%s a primit Kick de la BOT, Motiv: Weapon Hack",sendername);
SendClientMessageToAll(COLOR_RED, string);
Kick(i);
return 1;
}
}
return 1;
}
|
Re: Anti-WeaponHack - Problem -
Konstantinos - 26.03.2013
Make a timer and don't use OPU callback. Check if they're spawned, if they're not return 1 to the timer's callback for not checking, after they spawn (first time), check if they have the x, y etc. weapons and kick them.
Re: Anti-WeaponHack - Problem -
newbienoob - 26.03.2013
The best way to make anti weapon hacks without using any timer is by using OnPlayerKeyStateChange callback
pawn Код:
if(newkeys & KEY_FIRE && GetPlayerWeapon(playerid) == 35)
{
Kick(playerid);
}
They can have the weapons, but they can't shoot. If they shoot, they will get kicked.
Re: Anti-WeaponHack - Problem -
SupermanV - 26.03.2013
Hello!
I don't know lots of that script but 100% THIS guy will help you! He is AWESOME scripter + mapper...
TRUST ME

Here is my scripter's skype: savaldivieso
IF I help you,please +REP me to advertise my RP server

Reward,
SupermanV