Im making a Anti Weapon Hack System.... Quick Question
#1

Im making a Anti Weapon Hack System


And im just wondering i have made one and it kind of works but, when i do /giveweapon ( Which is a admin command ) and pick a weapon as soon as i pick it i get banned..... How can i stop that so only people that spawn weapons with hacks get banned


Please Help


Thank You So Much
Reply
#2

Please Help Me If You Need Any Part Of The Script Just Reply
Reply
#3

First, create a variable...
Code:
new aWeap[MAX_PLAYERS];
Then, in the /giveweapon command...
Code:
aWeap[playerid] = 1;
Then, in the Anti Cheat...
Code:
if(aWeap[playerid] == 0)
    Ban(playerid)
And under OnPlayerConnect, reset it...
Code:
aWeap[playerid] = 0;
Reply
#4

Quote:
Originally Posted by Catalyst-
View Post
First, create a variable...
Then, in the Anti Cheat...
Code:
if(aWeap[playerid] == 0)
    Ban(playerid)
[/code]
Where about does that bit go


Sorry im new to scripting
Reply
#5

Put it wherever you created your anti weapon hack code... or paste it here and I'll add it
Reply
#6

Is this what you mean


Code:
public OnPlayerUpdate(playerid)
{
            new weaponid = GetPlayerWeapon(playerid);//This will cause the "weaponid not defined" Error
                new Nam[MAX_PLAYER_NAME];
                new str[128];
            if(weaponid == 24) // The weapon ID
            {
            GetPlayerName(playerid,Nam,sizeof(Nam));
            format(str,sizeof(str),"ANTI WEAPON HACK: %s has been banned from server for spawning a bad weapon!",Nam);
            SendClientMessageToAll(0xFF0000FF,str);
            Kick(playerid,"ANTI WEAPON HACK: Weapon Hack!");
            }
                        return 1;
}
Reply
#7

Code:
public OnPlayerUpdate(playerid)
{
            new weaponid = GetPlayerWeapon(playerid);//This will cause the "weaponid not defined" Error
            new Nam[MAX_PLAYER_NAME];
            new str[128];
            if(weaponid == 24 && aWeap[playerid] == 0) // The weapon ID
            {
            GetPlayerName(playerid,Nam,sizeof(Nam));
            format(str,sizeof(str),"ANTI WEAPON HACK: %s has been banned from server for spawning a bad weapon!",Nam);
            SendClientMessageToAll(0xFF0000FF,str);
            Kick(playerid,"ANTI WEAPON HACK: Weapon Hack!");
            }
            return 1;
}
Reply
#8

You should work with server sided weapons, you can make yourself one, it's pretty easy. The script that catalyst provided wont work as it should.
Reply
#9

Quote:
Originally Posted by Marricio
View Post
You should work with server sided weapons, you can make yourself one, it's pretty easy. The script that catalyst provided wont work as it should.
It is working well though
Reply
#10

You need to replace every GivePlayerWeapon with GivePlayerWeaponEx

If you're using that recent Server Sided Weapons tutorial.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)