SA-MP Forums Archive
Weapon anti-cheat - 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: Weapon anti-cheat (/showthread.php?tid=134322)



Weapon anti-cheat - DarkPower - 16.03.2010

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


Re: Weapon anti-cheat - Jeffry - 16.03.2010

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


Re: Weapon anti-cheat - DarkPower - 16.03.2010

tny alot you help me


Re: Weapon anti-cheat - Jeffry - 16.03.2010

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


Re: Weapon anti-cheat - DarkPower - 16.03.2010

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 ?


Re: Weapon anti-cheat - MaykoX - 16.03.2010

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)


Re: Weapon anti-cheat - Jay_ - 16.03.2010

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.



Re: Weapon anti-cheat - MaykoX - 16.03.2010

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


Re: Weapon anti-cheat - DarkPower - 16.03.2010

ok i make it, im gonna try now