11.02.2012, 10:27
Hey, when I /deposit it takes the money from me, but it doesn't add it to the file
pawn Код:
CMD:deposit(playerid, params[])
{
new number, ammount;
if(!sscanf(params, "ii", number, ammount))
{
format(file, sizeof(file), "realityrp/bank/%d.ini", number);
if(fexist(file))
{
if(ammount <= GetPlayerMoney(playerid))
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, 2316.429443, -6.910340, 26.742187) || IsPlayerInRangeOfPoint(playerid, 10.0, 326.8708,131.4956,1007.9657))
{
new string[64];
format(string, sizeof(string), "You deposited %d dollar in this bank account.", ammount);
SendClientMessage(playerid, 0xFFFFFFFF, string);
new mon = dini_Int(file, "Money") + ammount;
dini_IntSet(file, "Money", mon);
GivePlayerMinusCash(playerid, ammount);
return 1;
}
else return SendClientMessage(playerid, COLOR_GREY, "You are not at the bank!");
}
else return SendClientMessage(playerid, COLOR_GREY, "You don't have that much money!");
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "The account you are trying to deposit money at, doesn't exist in our DataBase.");
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /deposit [Account Number] [Ammount]");
}