SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 06/08/2016, 04:26 PM   #11
Luicy.
Banned
 
Join Date: Dec 2014
Location: Sweden, Skövde
Posts: 775
Reputation: 79
Default Re: antiMoney.inc - ALS Hooking - OnPlayerHackMoney

Quote:
Originally Posted by SecretBoss View Post
Actually it is a server sided system you can remove the money directly or just don't give them return 0 on the GivePlayerMoney hook

That will prevent hackers from even using it, well they will use it but there will be no effect so they will give up that's the logic also you keep the player online instead of banning/kicking him

Edit:
I checked your code and it won't actually work because a hackers adds some money GivePlayerMoney is called you are putting the check for your callback on GetPlayerMoney for god sake what a logic

Your code is pointless
Saw your post just today so lemme respond;

I am checking at GetPlayerMoney, because look;
Whenever a player wants to hack money, they obviously hacking it to buy something, so when you check if they have the enough money example: if(GetPlayerMoney(playerid) > 99) So, they need 100, then it will run if they have hacked, this way we do not need any timer or anything like that, which is better because in my opinion it's useless to check for their money if they're not trying to use it.
Luicy. is offline   Reply With Quote
Old 06/08/2016, 04:39 PM   #12
Abagail
High-roller
 
Join Date: Dec 2013
Location: GetPlayerPos(playerid, pos); Scripter/Mapper.
Posts: 3,133
Reputation: 445
Default Re: antiMoney.inc - ALS Hooking - OnPlayerHackMoney

You should make antiMoney static so the variable name can still be used throughout the main script. You should also add IsPlayerConnected(or atleast valid range checks) to avoid runtime errors when a playerID above MAX_PLAYERS is used. I've taken a few minutes to make some adjustments, my version also returns INVALID PLAYER ID if an invalid playerID is used.

http://pastebin.com/3aDXWW1P

The naming of OnPlayerHackMoney is also a bit misleading, you should consider renaming it to something such as OnPlayerUseHackedMoney.
Abagail is offline   Reply With Quote
Old 06/08/2016, 04:52 PM   #13
Luicy.
Banned
 
Join Date: Dec 2014
Location: Sweden, Skövde
Posts: 775
Reputation: 79
Default Re: antiMoney.inc - ALS Hooking - OnPlayerHackMoney

Quote:
Originally Posted by Abagail View Post
You should make antiMoney static so the variable name can still be used throughout the main script. You should also add IsPlayerConnected(or atleast valid range checks) to avoid runtime errors when a playerID above MAX_PLAYERS is used. I've taken a few minutes to make some adjustments, my version also returns INVALID PLAYER ID if an invalid playerID is used.

http://pastebin.com/3aDXWW1P

The naming of OnPlayerHackMoney is also a bit misleading, you should consider renaming it to something such as OnPlayerUseHackedMoney.
Thanks and well, I'd not recommend making the variable static, because if you'd like to reset it and you'll use antiMoney[] == 0; then will the OnPlayerHackMoney run everytime, because it will think that the getplayermoney do not equal which it don't.
Luicy. is offline   Reply With Quote
Old 07/08/2016, 06:50 AM   #14
SecretBoss
Gangsta
 
SecretBoss's Avatar
 
Join Date: Dec 2014
Location: Greece
Posts: 807
Reputation: 106
Default Re: antiMoney.inc - ALS Hooking - OnPlayerHackMoney

Here is a quick script I made, I didn't test it yet test it and tell me

Code:
// Anti-Money Hack
// SecretBoss
// Version: 1.0
// Note: Not tested yet

static __SBAntiMoneyHack[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
	__SBAntiMoneyHack[playerid] = 0;
    #if defined SBAMH_OnPlayerConnect
        SBAMH_OnPlayerConnect(playerid);
    #endif
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	__SBAntiMoneyHack[playerid] = 0;
    #if defined SBAMH_OnPlayerDisconnect
        SBAMH_OnPlayerDisconnect(playerid, reason);
    #endif
    return 1;
}

stock SBAMH_GivePlayerMoney(playerid, amount)
{
    GivePlayerMoney(playerid, amount);
	__SBAntiMoneyHack[playerid] += amount;
	if(__SBAntiMoneyHack[playerid] != GetPlayerMoney(playerid))
	{
		CallRemoteFunction("OnPlayerHackMoney", "iii", playerid, GetPlayerMoney(playerid), __SBAntiMoneyHack[playerid]);
	}
    return 1;
}

stock SBAMH_ResetPlayerMoney(playerid)
{
    ResetPlayerMoney(playerid);
	__SBAntiMoneyHack[playerid] = 0;
    return 1;
}

// Hooks
#if defined _ALS_ResetPlayerMoney
    #undef ResetPlayerMoney
#else
    #define _ALS_ResetPlayerMoney
#endif
#define ResetPlayerMoney SBAMH_ResetPlayerMoney

#if defined _ALS_GivePlayerMoney
    #undef GivePlayerMoney
#else
    #define _ALS_GivePlayerMoney
#endif
#define GivePlayerMoney SBAMH_GivePlayerMoney


#if defined _ALS_OnPlayerConnect
    #undef OnPlayerConnect
#else
    #define _ALS_OnPlayerConnect
#endif
#define OnPlayerConnect SBAMH_OnPlayerConnect
#if defined SBAMH_OnPlayerConnect
    forward SBAMH_OnPlayerConnect(playerid);
#endif

#if defined _ALS_OnPlayerDisconnect
    #undef OnPlayerDisconnect
#else
    #define _ALS_OnPlayerDisconnect
#endif
#define OnPlayerDisconnect SBAMH_OnPlayerDisconnect
#if defined SBAMH_OnPlayerDisconnect
    forward SBAMH_OnPlayerDisconnect(playerid, reason);
#endif
__________________
SecretBoss is offline   Reply With Quote
Old 07/08/2016, 06:59 AM   #15
Luicy.
Banned
 
Join Date: Dec 2014
Location: Sweden, Skövde
Posts: 775
Reputation: 79
Default Re: antiMoney.inc - ALS Hooking - OnPlayerHackMoney

That's pretty much the same thing, just that you check at GivePlayerMoney
Luicy. is offline   Reply With Quote
Old 07/08/2016, 11:40 AM   #16
LifeRah
Big Clucker
 
LifeRah's Avatar
 
Join Date: Dec 2015
Location: Seattle - U.S
Posts: 197
Reputation: 23
Default Re: antiMoney.inc - ALS Hooking - OnPlayerHackMoney

Nice
LifeRah 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
[AntiMoney]Hack Helping ? donhu789 Scripting Help 4 11/10/2013 02:58 PM
Antimoney-hack Problem RedFusion Scripting Help 4 15/10/2012 10:31 AM
[Include] [INC] RenisiL - AntiMoney Cheat Guard System v0.1.1 RenisiL Includes 25 15/02/2012 07:41 PM
AntiMoney Hack Capitan_Price Help Archive 3 22/07/2011 09:07 PM
[HELP]LeveL Or Like something and Antimoney hack mystical122 Help Archive 1 23/07/2009 05:26 PM


All times are GMT. The time now is 10:28 AM.


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