CMD:withdraw(playerid, params[]){
if(AdminDuty[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin.");
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 2477.9370,2376.9744,-39.3672))
{
SendClientMessage(playerid, COLOR_GREY, "You're not at the bank!");
return 1;
}
new string[128], amount;
if(sscanf(params, "d", amount))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /withdraw [amount]");
format(string, sizeof(string), " You have $%d in your account.", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if(amount > PlayerInfo[playerid][pBank] || amount < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You don't have that much!");
return 1;
}
GivePlayerCash(playerid,amount);
PlayerInfo[playerid][pBank]=PlayerInfo[playerid][pBank]-amount;
format(string, sizeof(string), " You have withdrawn $%d from your account. Current balance: $%d ", amount,PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
CMD:deposit(playerid, params[]) {
if(AdminDuty[playerid] == 1)
{
SendClientMessage(playerid,COLOR_WHITE, "You can't use this command while on-duty as admin.");
return 1;
}
if(!IsPlayerInRangeOfPoint(playerid, 10.0, 2477.9370,2376.9744,-39.3672))
{
SendClientMessage(playerid, COLOR_GREY, "You're not at the bank!");
return 1;
}
new string[128], amount;
if(sscanf(params, "d", amount))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /deposit [amount]");
format(string, sizeof(string), " You have $%d in your account.", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
if(amount > GetPlayerCash(playerid) || amount < 1)
{
SendClientMessage(playerid, COLOR_GRAD2, " You don't have that much.");
return 1;
}
GivePlayerCash(playerid,-amount);
new curfunds = PlayerInfo[playerid][pBank];
PlayerInfo[playerid][pBank]=amount+PlayerInfo[playerid][pBank];
SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");
format(string, sizeof(string), " Old Balance: $%d", curfunds);
SendClientMessage(playerid, COLOR_GRAD2, string);
format(string, sizeof(string), " Deposit: $%d",amount);
SendClientMessage(playerid, COLOR_GRAD4, string);
SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");
format(string, sizeof(string), " New Balance: $%d", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
|
Mabye you copy past the CMD from other script to your script? try to check if your GM use zcmd include.
or try to use that: CMD:withdraw(playerid, params[]) instead that: CMD:withdraw(playerid, params[]){ - Just remove the "{" and tell me if it's work. If you want +rep me brother ![]() |
CMD:withdraw(playerid, params[])
{
if(AdminDuty[playerid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "You can't use this command while on-duty as admin.");
if(!IsPlayerInRangeOfPoint(playerid, 2477.9370,2376.9744,-39.3672)) return SendClientMessage(playerid, COLOR_GREY, "You're not at the bank!");
if(params[0] > PlayerInfo[playerid][pBank] || params[0] < 1) return SendClientMessage(playerid, COLOR_GRAD2, " You don't have that much!");
new string[128];
if(sscanf(params, "d", params[0]))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /withdraw [amount]");
format(string, sizeof(string), " You have $%d in your account.", PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_GRAD3, string);
return 1;
}
GivePlayerMoney(playerid, params[0]);
PlayerInfo[playerid][pBank] = PlayerInfo[playerid][pBank]-params[0];
format(string, sizeof(string), " Youґre withdrawn $%d from your account. Current balance: $%d ", params[0],PlayerInfo[playerid][pBank]);
SendClientMessage(playerid, COLOR_YELLOW, string);
return 1;
}
|
Check this script please
PHP код:
|
|
Please no... That's not the reason it's got an issue... Please, learn how structure works before suggesting things like this...
|