Little bank system help
#1

Hello so i created a little bank system in my script, the problem is when i type /withdraw <amount> it not showing a message that i have withdrawn or i don't have that much to withdraw and same thing in /deposit <amount>, and when i /checkbalance it says 0$..

PHP код:
CMD:deposit(playeridparams[])
{
    new 
string[256];
    new 
type;
    {
    if(
sscanf(params"i"type)) return SendClientMessage(playerid0xf8f8f8fff"Syntax: {f00f00}/deposit <amount>");
    if(
type == 0)
    if(
GetPlayerMoney(playerid) < type)
    {
    
GivePlayerMoney(playerid,-type);
    
PlayerInfo[playerid][pBankAccount] += type;
    
format(stringsizeof(string), "[BANK]: {Ffffff}You have successfully deposited {f00f00}$%d {FFFFFF}to your bank account."type);
    
SendClientMessage(playerid0xf8f8f8fffstring);
    }
    else 
SendClientMessage(playerid0xf8f8f8fff"ERROR: {FFFFFF}You do not have that much amount in your hand");
    }
    return 
1;
}
CMD:withdraw(playerid,params[])
{
   new 
string[256];
   new 
type;
   {
   if(
sscanf(params"i"type)) return SendClientMessage(playerid0xf8f8f8fff"Syntax: {f00f00}/withdraw <amount>");
   if(
type == 0)
   if(
PlayerInfo[playerid][pBankAccount] >= type)
   {
   
PlayerInfo[playerid][pBankAccount] -= type;
   
GivePlayerMoney(playeridtype);
   
format(stringsizeof(string), "[BANK]: {FFFFFF}You have successfully withdrawn {f00f00}$%d {FFFFFF}from your bank account."type);
   
SendClientMessage(playerid0xF8f8f8fffstring);
   }
   else 
SendClientMessage(playerid0xF8f8f8ffF"ERROR: {FFFFFF}You do not have that much amount in your account");
   }
   return 
1;
}
CMD:checkbalance(playerid,params[])
{
   new 
string[256];
   
format(stringsizeof(string), "[BANK] {FFFFFF}You currently have $%d In your bank account."PlayerInfo[playerid][pBankAccount]);
   
SendClientMessage(playerid,0xf8f8f8fff,string);
   return 
1;

Usiing Y_INI.
Reply


Messages In This Thread
Little bank system help - by RxErT - 10.06.2017, 17:59
Re: Little bank system help - by Vince - 10.06.2017, 18:07
Re: Little bank system help - by RxErT - 10.06.2017, 18:11
Re: Little bank system help - by Bolex_ - 10.06.2017, 18:16
Re: Little bank system help - by RxErT - 10.06.2017, 18:18

Forum Jump:


Users browsing this thread: 1 Guest(s)