31.10.2012, 21:34
Hey guys!
At a dialog you buy a car you have the following code:
Now if the player had 2000 dollars and the vehicle costs 50, the print would read: 1950.
Even at SaveData (include file with all playerinfo's in it) I have the following:
And guess what? Its still 1950 yet it didnt save into the file! So next time I spawn I still have 200 dollars!
How to fix this?
At a dialog you buy a car you have the following code:
Код:
GivePlayerMoney(playerid, -VehicleValue[ids]); PlayerInfo[playerid][pMoney] = PlayerInfo[playerid][pMoney]-VehicleValue[ids]; printf("Money: %i",PlayerInfo[playerid][pMoney]); SaveData(playerid);
Even at SaveData (include file with all playerinfo's in it) I have the following:
Код:
public SaveData(playerid) { UserDataSave_data(playerid); return 1; } UserDataSave_data(playerid) { new uFile[35]; format(uFile, 35, USER_FILE, GetName(playerid)); new INI:file = INI_Open(uFile); //will open their file INI_WriteInt(file,"Money",PlayerInfo[playerid][pMoney]); printf("Money:%i", PlayerInfo[playerid][pMoney]); }
How to fix this?