06.01.2011, 23:31
(
Последний раз редактировалось DRIFT_HUNTER; 23.01.2011 в 16:15.
)
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
2.
If you use it in filterscript just skip these step
If you want to use it in GameMode
Add
3.Add
4.
Change samp function's to anticheat one
5.Add Anticheat callback
6.Compile script
Anticheat functions:
Callback's
[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
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>
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;
}
pawn Код:
public OnPlayerConnect(playerid)
{
PlayerConnect(playerid);//Add these under OnPlayerConnect
return 1;
}
public OnPlayerDisconnect(playerid)
{
PlayerDisconnect(playerid);//Add these under OnPlayerDisconnect
return 1;
}
Change samp function's to anticheat one
pawn Код:
GivePlayerWeapon - to - GivePlayerGun
SetPlayerAmmo - to - SetPlayerAmmoPerSlot
ResetPlayerWeapons- to - ResetPlayerGuns
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;
}
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
pawn Код:
OnAnticheatDetectWeaponCheat(playerid,weaponid,type)
//If type = 0 Player spawned weapon
//If type = 1 Player spawned ammo for weapon
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