Weapon anti-cheat
#1

i jut wanna to ask how to make simple weapon anti-cheat can anyone give me example? tny
Reply
#2

Untested:

pawn Code:
#include <a_samp>

new Minigun;

public OnFilterScriptInit()
{
    Minigun=SetTimer("Anti_Minigun",1000,1);
    return 1;
}

public OnFilterScriptExit()
{
    KillTimer(Minigun);
    return 1;
}

forward Anti_Minigun();
public Anti_Minigun()
{
for(new i =0; i < MAX_PLAYERS; i++)
        {
        new weap;
        new ammo;
        GetPlayerWeaponData(i, 7, weap, ammo);
        if(ammo >= 1 && weap == 38)
            {
            //Ban him, whatever, but try it with kick, if its wrongly working.
            }
        }
return 1;
}
Jeffry
Reply
#3

tny alot you help me
Reply
#4

Quote:
Originally Posted by DarkPower
tny alot you help me
No problem.
Reply
#5

Quote:
Originally Posted by Jeffry
Quote:
Originally Posted by DarkPower
tny alot you help me
No problem.
probelm again....

http://pastebin.com/i4WZx7Ni

and when player get anyyy of this weapon he dont get ban, but if i put just one weapon ID it will get ban -.- can anyone help me this is very important to me and my community ?
Reply
#6

Quote:
Originally Posted by DarkPower
Quote:
Originally Posted by Jeffry
Quote:
Originally Posted by DarkPower
tny alot you help me
No problem.
probelm again....

http://pastebin.com/i4WZx7Ni

and when player get anyyy of this weapon he dont get ban, but if i put just one weapon ID it will get ban -.- can anyone help me this is very important to me and my community ?
More simple ? if(ammo >= 1 && weap == 38 || 37 || 36...) or just go with if(ammo >= 1 && weap == 1 || 2 etc. lawl)
Reply
#7

That won't work, you have to declare the value you're checking first.

Code:
if( (ammo >= 1) && weapon == 38 || weapon == 39 || weapon == 40)
DarkPower: Your code is very messy and unorganised. Try adding comments and indenting it a bit first, it's too hard to read.
Reply
#8

Quote:
Originally Posted by _Jay_
That won't work, you have to declare the value you're checking first.

Code:
if( (ammo >= 1) && weapon == 38 || weapon == 39 || weapon == 40)
DarkPower: Your code is very messy and unorganised. Try adding comments and indenting it a bit first, it's too hard to read.
ok i forgot about that xD
Reply
#9

ok i make it, im gonna try now
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)