Anti weapon hack help
#1

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);
Reply
#2

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;
}
}
}
}
}
Reply
#3

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)
	    {
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)