12.07.2015, 05:53
Welcome to this site bartiss122 aka Vortex. Certainly in the handbooks already noticed the kind of pseudo-tutorial on anti money hack.
Today I will try to explain it all to you.
So to do:
Table:
Anti Money Hack is very necessary for servers SA: MP. It is in order to protect our server from spawning money, it is usually made on the basis of saving money in some variable of type: New Cash [MAX_PLAYERS].
Variable and code
So, yes, we begin our work, for starters, you need to write at the top of the script a_samp include:
Then the variable we include where the player will be safe in my case it will be Checkout:
I did variable now what? We have to somehow hack or something. To this should be the following code:
Okay, so the code looks like this:
Of course I do not recommend giving cash now using GivePlayerMoney, only by:
Here you have a function that will be the same as giveplayermoney, but under our script:
Application:
I did Anti Money Hack
Today I will try to explain it all to you.
So to do:
Table:
- introduction
- Variable and code
Anti Money Hack is very necessary for servers SA: MP. It is in order to protect our server from spawning money, it is usually made on the basis of saving money in some variable of type: New Cash [MAX_PLAYERS].
Variable and code
So, yes, we begin our work, for starters, you need to write at the top of the script a_samp include:
Code:
#include <a_samp> //The main Library SA:MP
Code:
new Cash[MAX_PLAYERS]; //We create a variable
Code:
public OnPlayerUpdate(playerid) { if(Cash[playerid] != GetPlayerMoney(playerid)) //Check if the variable Ticket has the same value as cash. { Kick(playerid); // Kick function that will be called when a player will not have as much cash. } return 1; }
Code:
#include <a_samp> //The main Library SA:MP new Cash[MAX_PLAYERS]; //We create a variable public OnPlayerUpdate(playerid) { if(Cash[playerid] != GetPlayerMoney(playerid)) //Check if the variable Ticket has the same value as cash. { Kick(playerid); // Kick function that will be called when a player will not have as much cash. } return 1; }
Code:
GivePlayerMoney(playerid, amount); Cash[playerid] += amount;
Code:
stock GivePlayerCash(playerid, amount) { GivePlayerMoney(playerid, amount); Cash[playerid] += amount; return 1; }
Code:
GivePlayerCash(playerid, 100);