Posts: 3,351
Threads: 780
Joined: Jan 2010
Hello, i found this server side money method here on the forum and i applied it:
Код:
#define GivePlayerCash(%0,%1) SetPVarInt(%0,"Money",GetPlayerCash(%0)+%1),GivePlayerMoney(%0,%1)
#define ResetPlayerCash(%0) SetPVarInt(%0,"Money",0), ResetPlayerMoney(%0)
#define GetPlayerCash(%0) GetPVarInt(%0,"Money")
I replaced GivePlayerMoney with GivePlayerCash, ResetPlayerMoney with ResetPlayerCash and GetPlayerMoney with GetPlayerCash, but is not working.
I tried with a famous cheat and money doesn't get reset to the original quantity.
(I don't have any timer, just added this defines and replaced all original money variables.)
What's wrong?
Posts: 3,715
Threads: 358
Joined: Apr 2012
Reputation:
0
Did you make sure you have the codes that will reset the hacker's money back to it's original money?
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by JaKe Elite
Did you make sure you have the codes that will reset the hacker's money back to it's original money?
|
Emh no i don't have that code...
Quote:
Originally Posted by Prokill911
PHP код:
public GetMoneyEx(playerid) {
return GetPVarInt(playerid, "Money");
}
public GiveMoneyEx(playerid, money) {
new bmoney = GetMoneyEx(playerid);
bmoney += money;
SetPVarInt(playerid, "Money", bmoney);
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid, bmoney);
}
Try that.
|
I don't need another custom variabe, i already have one.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Posts: 10,066
Threads: 38
Joined: Sep 2007
Reputation:
0
The money bar will not update as long as you don't do anything with the money. Cheated money is purely cosmetic in this sense; it only displays in the HUD. Yet as soon as you try to buy something the script will fall back to the server sided money.
Posts: 3,351
Threads: 780
Joined: Jan 2010
Quote:
Originally Posted by Banana_Ghost
PHP код:
#define CheckPlayerCash(%0) if(GetPlayerMoney(%0) > GetPVarInt(%0,"Money")) ResetPlayerMoney(%0), GivePlayerMoney(%0,GetPVarInt(%0,"Money))
Use something along those lines, it might need editing (it's 6:37am). Place it either in a 1 second timer or under OnPlayerUpdate.
|
Doesn't work.
Quote:
Originally Posted by Vince
The money bar will not update as long as you don't do anything with the money.
|
Yes i know. I need the code to reset player's money when they are earned by cheats and not given by server..can you help me?
Posts: 3,351
Threads: 780
Joined: Jan 2010