24.03.2011, 20:50
Quote:
Use 'strval(params)' instead of 'params[0]', as strval returns the actual value in the string, and params[x] only returns the (ASCII-) value of the given character.
|
as i wanna deposit the same amount twice, it wont write the value in the file, my code:
pawn Код:
CMD:deposit(playerid, params[])
{
//statements etc...
new PlayerFile[13 + MAX_PLAYER_NAME];
format(PlayerFile, sizeof PlayerFile, "Accounts/%s.ini", Encode(PlayaName(playerid)));
new INI:PlayerAcc = INI_Open(PlayerFile);
INI_WriteInt(PlayerAcc, "BANK", GetPVarInt(playerid, "Bank") + strval(params));
INI_Close(PlayerAcc);
GivePlayerMoney(playerid,-strval(params));
return 1;
}