SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Includes

Reply
 
Thread Tools Display Modes
Old 07/01/2011, 12:31 AM   #1
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,096
Reputation: 174
Cool Weapon+ammo anticheat [BETA]

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 Code:
#include <anticheat>
2.
If you use it in filterscript just skip these step
If you want to use it in GameMode
Add
pawn Code:
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 Code:
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 Code:
GivePlayerWeapon   - to - GivePlayerGun
SetPlayerAmmo       - to - SetPlayerAmmoPerSlot
ResetPlayerWeapons- to - ResetPlayerGuns
5.Add Anticheat callback
pawn Code:
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 Code:
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 Code:
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
__________________
Путин here,
Путин there,
Путин просто everywhere.


Any PM's that include question about any kind of help will be ignored.
Use appropriate boards for that

Last edited by DRIFT_HUNTER; 23/01/2011 at 05:15 PM.
DRIFT_HUNTER is offline   Reply With Quote
Old 07/01/2011, 01:03 AM   #2
[Ips]Guh
Gangsta
 
[Ips]Guh's Avatar
 
Join Date: Apr 2010
Location: Brazil
Posts: 847
Reputation: 62
Default Re: Weapon+ammo anticheat [BETA]

Hmmmmm ...... Very Good...
Good Job...
[Ips]Guh is offline   Reply With Quote
Old 07/01/2011, 02:20 AM   #3
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,250
Reputation: 1141
Default Re: Weapon+ammo anticheat [BETA]

Looks great, nice inc.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline   Reply With Quote
Old 07/01/2011, 06:18 AM   #4
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 3,977
Reputation: 1587
Default Re: Weapon+ammo anticheat [BETA]

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
Kwarde is offline   Reply With Quote
Old 07/01/2011, 07:16 PM   #5
DRIFT_HUNTER
High-roller
 
Join Date: Oct 2009
Posts: 2,096
Reputation: 174
Default Re: Weapon+ammo anticheat [BETA]

Quote:
Originally Posted by Kwarde View Post
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
__________________
Путин here,
Путин there,
Путин просто everywhere.


Any PM's that include question about any kind of help will be ignored.
Use appropriate boards for that
DRIFT_HUNTER is offline   Reply With Quote
Old 07/01/2011, 07:21 PM   #6
Cacoby
Huge Clucker
 
Cacoby's Avatar
 
Join Date: Jul 2010
Posts: 218
Reputation: 3
Default Respuesta: Weapon+ammo anticheat [BETA]

nice job
good inc

:P
Cacoby is offline   Reply With Quote
Old 07/01/2011, 08:34 PM   #7
wups
High-roller
 
wups's Avatar
 
Join Date: Apr 2010
Location: Lithuania
Posts: 1,251
Reputation: 137
Default Re: Weapon+ammo anticheat [BETA]

Can be done with much more efficient ways. Other than that, i think it's nice, but you should really consider optimizing it.
wups is offline   Reply With Quote
Old 30/01/2014, 09:15 AM   #8
NimaKhan
Little Clucker
 
Join Date: Jan 2014
Posts: 8
Reputation: 0
Default Re: Weapon+ammo anticheat [BETA]

please fix link i need it
NimaKhan is offline   Reply With Quote
Old 19/02/2019, 10:51 PM   #9
BOyka1
Little Clucker
 
Join Date: Sep 2017
Posts: 9
Reputation: 0
Default Re: Weapon+ammo anticheat [BETA]

Any updated link?
BOyka1 is offline   Reply With Quote
Old 19/02/2019, 10:57 PM   #10
HNIC
Big Clucker
 
HNIC's Avatar
 
Join Date: Jun 2017
Location: Downtown
Posts: 56
Reputation: 4
Default Re: Weapon+ammo anticheat [BETA]

Quote:
Originally Posted by BOyka1 View Post
Any updated link?
There are way better anticheats, and you shouldn't bump a thread that's over 4 years old.
__________________
yeet.
HNIC is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Give ammo to a weapon slot ZamaXor Help Archive 8 25/09/2010 06:43 AM
Need help GivePlayerAmmo(playerid, weapon, ammo); Cypress Help Archive 9 02/08/2010 01:17 AM
Giving player weapon without ammo misko28 Help Archive 3 28/05/2010 07:12 PM
[HELP] Weapon ammo out... whitedragon Help Archive 7 28/04/2010 11:47 AM
How To Make Anti Ammo more than 1 ammo weapon jame20702 Help Archive 0 12/12/2009 08:00 AM


All times are GMT. The time now is 11:35 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.