15.08.2012, 12:58
I scripted so you start with 500, but when i join i got 2 000 and after i buy something for ec 10, i get 490 but every time i log in i start with 2000 why?
new dollah = 2000; |
stock GivePlayerCash(playerid, money)
{
PlayerInfo[playerid][pCash] += money;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}
stock SetPlayerCash(playerid, money)
{
PlayerInfo[playerid][pCash] = money;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}
stock ResetPlayerCash(playerid)
{
PlayerInfo[playerid][pCash] = 0;
ResetMoneyBar(playerid);
UpdateMoneyBar(playerid,PlayerInfo[playerid][pCash]);
return PlayerInfo[playerid][pCash];
}
stock GetPlayerCash(playerid)
{
return PlayerInfo[playerid][pCash];
}
PlayerInfo[playerid][pCash] = GetPlayerCash(playerid);
format( String, sizeof( String ), "UPDATE `Accounts`, `Money` = '%d', `Skin` = '%d', `SpawnPoint` = '%d', `HouseKey` = '%d', `BizKey` = '%d' WHERE `UserID` = '%d'"
,PlayerInfo[playerid][pCash],PlayerInfo[playerid][pSkin],PlayerInfo[playerid][pSpawnPoint],PlayerInfo[playerid][pHouseKey],PlayerInfo[playerid][pBizKey],PlayerInfo[playerid][pDatabaseID]);
mysql_query(String);