SA-MP Forums Archive
[Tutorial] Deduction - Anti-Weapon Hack - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] Deduction - Anti-Weapon Hack (/showthread.php?tid=319800)

Pages: 1 2


Re: Deduction - Anti-Weapon Hack - ilijas - 03.07.2012

can u help me if i send you my script on pm
you'll see if i place something wrong
answer me please


Re: Deduction - Anti-Weapon Hack - czop1223 - 23.04.2013

how to do it via timer? pls help


Re: Deduction - Anti-Weapon Hack - dEcooR - 14.06.2013

Dude i go test it now

btw what did you means with new PID?

CMD:givegun(playerid, params[])
{
new PID; //
if(sscanf(params, "i", weaponid)) return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /givegun [Weapon ID] [ammo]");
ServerWeapon(playerid, weaponid, ammo);
return 1;
}

And by the way i found some bug .. i found that if you using setspawninfo(there you can set also weaps) and addplayerclass(also set weps) you are kicked .. cuz it setting server not you so thats sucked


Re: Deduction - Anti-Weapon Hack - cyber_punk - 15.06.2013

Question, why do you call your functions macro's when they are not, they are just functions.....

Random Macro
pawn Код:
#define MAX_PLAYERS_TIMES_NUMBER(%0)    MAX_PLAYERS * %0
Suggest you give this thread a read: https://sampforum.blast.hk/showthread.php?tid=166680


Re: Deduction - Anti-Weapon Hack - Chrillzen - 18.10.2013

Does not work for meele weapons.. Bans me even if I use ServerWeapon.


Respuesta: Deduction - Anti-Weapon Hack - Nitrome - 22.10.2013

NICE.


Re: Deduction - Anti-Weapon Hack - cessil - 03.12.2013

you should be using hooks for GivePlayerWeapon so you don't have to edit anything in your script
you've also skipped over any issues players could have like lag or desync, (there's a link to the anti cheat tips thread in my signature)
for example if a player has an ak-47 and then you give them an m4, unless they update instantaneously (not going to happen) your script will consider them using cheats

also your script is very messy, here's a trimmed down version based on copy + pasting other peoples work

pawn Код:
#define WEAPON_SLOT_COUNT 13 //0 - 12

new Weapons[MAX_PLAYERS][WEAPON_SLOT_COUNT];

stock GetWeaponSlot(weaponid)
{
    new slot;
    switch(weaponid)
    {
        case 0,1: slot = 0;
        case 2 .. 9: slot = 1;
        case 10 .. 15: slot = 10;
        case 16 .. 18, 39: slot = 8;
        case 22 .. 24: slot = 2;
        case 25 .. 27: slot = 3;
        case 28, 29, 32: slot = 4;
        case 30, 31: slot = 5;
        case 33, 34: slot = 6;
        case 35 .. 38: slot = 7;
        case 40: slot = 12;
        case 41 .. 43: slot = 9;
        case 44 .. 46: slot = 11;
    }
    return slot;
}
//https://sampforum.blast.hk/showthread.php?pid=782197#pid782197

stock CheckWeapons(playerid)
{
    new weaponid = GetPlayerWeapon(playerid);
    new slot = GetWeaponSlot(weaponid);
    if(Weapons[playerid][slot] != weaponid)
    {
        //not equal to the server's data
    }
    //don't even need to return anything
}

stock ServerWeapon(playerid, weaponid, ammo)
{
    new slot = GetWeaponSlot(weaponid);
    Weapons[playerid][slot] = weaponid;
    GivePlayerWeapon(playerid, weaponid, ammo);
}



Re: Deduction - Anti-Weapon Hack - Gastro - 04.12.2013

Thanks man, this was really helpful.