admin command trouble info saving to mysql
#2

You have to save his money everytime you change it.

i would also recommend using serversided money because it can not be hacked.

PHP код:
GivePlayerCash(playeridmoney)
{
    
pInfo[targetid][pMoney] += money;
    if(
pInfo[playerid][IsLoggedIn] == true)
     {
        new 
str[128];
        
mysql_format(SQLstr,128,"UPDATE `users` SET `Cash`='%d' WHERE `id` = '%d' LIMIT 1",pInfo[playerid][Cash],pInfo[playerid][ID]);
        
mysql_tquery(SQLstr"""");
    }
    
UpdateMoneyBar(playerid,pInfo[playerid][Cash]);
    if(
pInfo[playerid][pMoney] != GetPlayerMoney(playerid))
    {
        
GivePlayerMoney(playeridpInfo[playerid][Cash] - GetPlayerMoney(playerid));
    }
    return 
pInfo[playerid][Cash];

add this to your gamemode and replace
Код:
GivePlayerMoney
with
Код:
GivePlayerCash
also,change that according to your variables. good luck

Код:
UpdateMoneyBar
simply gives him money with GivePlayerMoney according to his serversided money ( so the green money bar updates )
Reply


Messages In This Thread
admin command trouble info saving to mysql - by Zeus666 - 05.03.2018, 18:05
Re: admin command trouble info saving to mysql - by PepsiCola23 - 05.03.2018, 18:25
Re: admin command trouble info saving to mysql - by Zeus666 - 05.03.2018, 18:43
Re: admin command trouble info saving to mysql - by PepsiCola23 - 05.03.2018, 22:30

Forum Jump:


Users browsing this thread: 1 Guest(s)