26.03.2011, 09:47
Because he doesn't need sscanf in this case.
You forgot SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank") + strval(params));
pawn Код:
CMD:bank(playerid, params[])
{
//Statements like sscanf, Insufficient Funds and etc...
new PlayerFile[13 + MAX_PLAYER_NAME];
format(PlayerFile, sizeof PlayerFile, "Accounts/%s.ini", Encode(PlayaName(playerid)));
if(GetPVarInt(playerid, "Bank") + strval(params) > 100000)
{
SendClientMessage(playerid, -1, ""COL_RED"ERROR:{FFFFFF} Your bank account can only hold 100 000$");
}
else
{
new INI:PlayerAcc = INI_Open(PlayerFile);
INI_WriteInt(PlayerAcc,"BANK",GetPVarInt(playerid, "Bank") + strval(params));
INI_Close(PlayerAcc);
GivePlayerMoney(playerid,-strval(params));
SetPVarInt(playerid, "Bank", GetPVarInt(playerid, "Bank") + strval(params));
new string[128];
format(string,sizeof(string),"You have successfully banked %d$ into your bank account.",strval(params));
SendClientMessage(playerid,COLOR_GREEN,string);
}
return 1;
}