18.09.2015, 20:41
What about this one?:
PHP код:
CMD:deposit(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 2, -2455.4519, 503.9336, 30.0781))
{
new amount;
if(sscanf(params, "d", amount)) return SendClientMessage(playerid, -1, "USAGE: /deposit [amount]");
if(GetPlayerMoney(playerid) < amount || amount < 1) return SendClientMessage(playerid, -1, "Error: You haven't that much money or invalid amount.");
GivePlayerMoney(playerid, -amount);
pInfo[playerid][Bank] += amount;
}
return 1;
}
CMD:withdraw(playerid, params[])
{
if(IsPlayerInRangeOfPoint(playerid, 2, -2455.4519, 503.9336, 30.0781))
{
new amount;
if(sscanf(params, "d", amount)) return SendClientMessage(playerid, -1, "USAGE: /withdraw [amount]");
if(pInfo[playerid][Bank] < amount || amount < 1) return SendClientMessage(playerid, -1, "Error: You haven't that much money or invalid amount.");
GivePlayerMoney(playerid, amount);
pInfo[playerid][Bank] -= amount;
}
return 1;
}