Server side money not working
#1

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?
Reply
#2

Did you make sure you have the codes that will reset the hacker's money back to it's original money?
Reply
#3

PHP код:
public GetMoneyEx(playerid) {
    return 
GetPVarInt(playerid"Money");
}
public 
GiveMoneyEx(playeridmoney) {
    new 
bmoney GetMoneyEx(playerid);
    
bmoney += money;
    
SetPVarInt(playerid"Money"bmoney);
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridbmoney);

Try that.
Reply
#4

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(playeridmoney) {
    new 
bmoney GetMoneyEx(playerid);
    
bmoney += money;
    
SetPVarInt(playerid"Money"bmoney);
    
ResetPlayerMoney(playerid);
    
GivePlayerMoney(playeridbmoney);

Try that.
I don't need another custom variabe, i already have one.
Reply
#5

Bump
Reply
#6

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.
Reply
#7

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.
Reply
#8

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?
Reply
#9

Fixed.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)