SA-MP Forums Archive
Anti weapon hack help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti weapon hack help (/showthread.php?tid=125099)



Anti weapon hack help - Perker12345 - 02.02.2010

How do i edit the weapon ID's ? Because it spams the chat if somebody is running around with a RPG (The normal one) And that weapon is used in my gamemode, what lines do i have to edit to set so the RPG is a "okay" weapon.
pawn Code:
new x_wep, xamm;
        GetPlayerWeaponData(i, 7, x_wep, xamm);
        if(x_wep > 0 && xamm > 0)
        {
                GetPlayerName(i, kickname, sizeof(kickname));
                format(kstring, 128, "[Warning] (%d)%s was found having an unscripted weapon! (%d)",i,kickname,x_wep);
                AdministratorMessage(COLOR_RED,kstring,1);
                HackLog(kstring);
                printf("%s", kstring);
        }
        GetPlayerWeaponData(i, 8, x_wep, xamm);
        if(x_wep == 16 && xamm > 0)
        {
                GetPlayerName(i, kickname, sizeof(kickname));
                format(kstring, 128, "AdmWarning: [%d]%s was found having an unscripted weapon! (%d)",i,kickname,x_wep);
                AdministratorMessage(COLOR_RED,kstring,1);
                HackLog(kstring);
                printf("%s", kstring);



Re: Anti weapon hack help - [WSM]Deadly_Evil - 02.02.2010

Here you go:
On the UP of the GM/FS:
Code:
#define YELLOW 0xFFFF00FF
at OnPlayerSpawn
Code:
new string[256];
new player[MAX_PLAYER_NAME];
GetPlayerName(playerid, player, sizeof(player));
if(reason == 35)
{
Kick (killerid);
format(string, sizeof(string), "Server has kicked %s for Hacking(reason: Rocket Launcher)", player);
SendClientMessageToAll(YELLOW, string);
}
else
{
if(reason == 36)
{
Kick(killerid);
format(string, sizeof(string), "Server has kicked %s for Hacking (reason: HS Rocket Launcher)", player);
SendClientMessageToAll(YELLOW, string);
}
else
{
if(reason == 37)
{
Kick(killerid);
format(string, sizeof(string), "Server has kicked %s for Hacking (reason: Flamethrower)", player);
SendClientMessageToAll(YELLOW, string);
}
else
{
if(reason == 38)
{
Kick(killerid);
format(string, sizeof(string), "Server has kicked %s for Hacking(reason: Minigun)", player);
SendClientMessageToAll(YELLOW, string);
}
else
{
if(IsPlayerAdmin(playerid))
return;
}
}
}
}
}



Re: Anti weapon hack help - mansonh - 02.02.2010

Well the rocket launcher slot includes rocket launcher through minigun, and it returns the number of the weapon:
https://sampwiki.blast.hk/wiki/Weapons

luckely rocket launcher is the lowest weapon number in slot 7

so just do
Code:
GetPlayerWeaponData(i, 7, x_wep, xamm);
	    if(x_wep > 359 && xamm > 0)
	    {