[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


Messages In This Thread
Weapon+ammo anticheat [BETA] - by DRIFT_HUNTER - 06.01.2011, 23:31
Re: Weapon+ammo anticheat [BETA] - by [Ips]Guh - 07.01.2011, 00:03
Re: Weapon+ammo anticheat [BETA] - by Lorenc_ - 07.01.2011, 01:20
Re: Weapon+ammo anticheat [BETA] - by Kwarde - 07.01.2011, 05:18
Re: Weapon+ammo anticheat [BETA] - by DRIFT_HUNTER - 07.01.2011, 18:16
Respuesta: Weapon+ammo anticheat [BETA] - by Cacoby - 07.01.2011, 18:21
Re: Weapon+ammo anticheat [BETA] - by wups - 07.01.2011, 19:34
Re: Weapon+ammo anticheat [BETA] - by NimaKhan - 30.01.2014, 08:15
Re: Weapon+ammo anticheat [BETA] - by BOyka1 - 19.02.2019, 21:51
Re: Weapon+ammo anticheat [BETA] - by HNIC - 19.02.2019, 21:57

Forum Jump:


Users browsing this thread: 1 Guest(s)