27.07.2010, 21:44
Im making a bank, but deposit command is bugged, it just takes my money, it doesnt insert to the savefile or bank. Balance is still 0 after i deposited.
pawn Код:
dcmd_deposit(playerid, params[])
{
if(!IsPlayerInRangeOfPoint(playerid, 5, 2316.6206, -7.2522, 26.7422)) return SendClientMessage(playerid, red, "Error: You must be in the bank checkpoint to use this command");
new amount, deposit, money = GetPlayerMoney(playerid);
amount = strval(params);
if(amount == 0 || amount < 0) return SendClientMessage(playerid, red, "Error: Invalid amount");
if(amount > money || amount == money) return SendClientMessage(playerid, red, "Error: Invalid amount");
GivePlayerMoney(playerid, -amount);
deposit = udb_UserInt(Name(playerid)).("Deposited");
udb_UserSetInt(Name(playerid)).("Deposited", deposit+amount);
return 1;
}