[Include] Weapon+ammo anticheat [BETA]
#1

Here is one Weapon+ammo anticheat
First version used GetPlayerWeaponData and it always give me wrong ammo amount so i replaced it with GetPlayerWeapon and GetPlayerAmmo


-How to use it?
1.
Add at top of the script
pawn Код:
#include <anticheat>
2.
If you use it in filterscript just skip these step
If you want to use it in GameMode
Add
pawn Код:
public OnGameModeInit()
{
    //AnticheatInit(time)
    AnticheatInit(1000);//Set your update time HERE(in milisecunds) (In these case its 1 second)
    return 1;  
}
public OnGameModeExit()
{
    AnticheatExit();
    return 1;
}
3.Add
pawn Код:
public OnPlayerConnect(playerid)
{
    PlayerConnect(playerid);//Add these under OnPlayerConnect
    return 1;
}
public OnPlayerDisconnect(playerid)
{
    PlayerDisconnect(playerid);//Add these under OnPlayerDisconnect
    return 1;
}
4.
Change samp function's to anticheat one
pawn Код:
GivePlayerWeapon   - to - GivePlayerGun
SetPlayerAmmo       - to - SetPlayerAmmoPerSlot
ResetPlayerWeapons- to - ResetPlayerGuns
5.Add Anticheat callback
pawn Код:
OnAnticheatDetectWeaponCheat(playerid,weaponid,type)
{
    //These is called when Anticheat detect cheat
    //If type = 0 Player spawned weapon
    //If type = 1 Player spawned ammo for weapon

    //Example on how to use
    new string[128];
    switch(type)
    {
        case 0: format(string,sizeof(string),"[ANTICHEAT]Kicked playerid %d for spawning weapon %d",playerid,weaponid);
        case 1: format(string,sizeof(string),"[ANTICHEAT]Kicked playerid %d for spawning ammo for weapon %d",playerid,weaponid);
    }
    Kick(playerid);
    SendClientMessageToAll(COLOR_RED,string);
    return 1;
}
6.Compile script

Anticheat functions:
pawn Код:
AnticheatInit(time);//These must be called on gamemode init
AnticheatExit();//These must be called on GameMode exit
PlayerConnect(playerid);//These must be called OnPlayerConnect
PlayerDisconnect(playerid);//These must be called OnPlayerDisconnect
SetPlayerGun(playerid,weaponid,ammo);
ResetPlayerGuns(playerid);
SetPlayerAmmoPerSlot(playerid,weaponslot,ammo);
GetWeaponSlot(weaponid);//Cant remember who posted these but its not by me
Callback's
pawn Код:
OnAnticheatDetectWeaponCheat(playerid,weaponid,type)
//If type = 0 Player spawned weapon
//If type = 1 Player spawned ammo for weapon
[NOTE]GameMode must use anticheat in order to use these anticheat in filterscript
Known bug's:
None for now

License:
1.Use it
2.Love it
3.Sell it
4.Claim it - Optional xD
5.Declare war to cheaters

If you do not agree you still can use it :P
Download--->>>http://www.mediafire.com/?j3kkw58ntcf640g

IF YOU FIND ANY BUG REPORT IT HERE
Reply
#2

Hmmmmm ...... Very Good...
Good Job...
Reply
#3

Looks great, nice inc.
Reply
#4

idk if it's good.
However I came here for a tip:

You added the 'PlayerConnect' ETC in the OnPlayerConnect.
You can also use CallRemoteFunction or CallLocalFunction
Then, player's don't need to add the PlayerConnect etc stuff
Reply
#5

Quote:
Originally Posted by Kwarde
Посмотреть сообщение
idk if it's good.
However I came here for a tip:

You added the 'PlayerConnect' ETC in the OnPlayerConnect.
You can also use CallRemoteFunction or CallLocalFunction
Then, player's don't need to add the PlayerConnect etc stuff
Well thats used just to reset player variables.There is no need foe that
And its not public function
Anyway thx for suggestion
Reply
#6

nice job
good inc

:P
Reply
#7

Can be done with much more efficient ways. Other than that, i think it's nice, but you should really consider optimizing it.
Reply
#8

please fix link i need it
Reply
#9

Any updated link?
Reply
#10

Quote:
Originally Posted by BOyka1
Посмотреть сообщение
Any updated link?
There are way better anticheats, and you shouldn't bump a thread that's over 4 years old.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)