Medical fees
#1

Well, I'm trying . If player has money less than 50k in bank. So, It should take money from player's hand cash.
If player has more more than 50k in bank so it should use bank cash.


Example:

I have less than 50k in bank. It should be take cash from my hand.
I have more than 50k in bank . It should take money from bank.

Here's code: I tried but can't get this.

PHP код:
if(pInfo[playerid][pBankMoney] < 50000)
    {
          new 
string2[500];
          new 
wealth GetPlayerCash(playerid) + pInfo[playerid][pBankMoney];
          new 
medfee = (12*wealth)/100;
          
GivePlayerCashEx(playerid,-medfee);
          
format(stringsizeof(string), "%s (%d) has paid $%d in medical fees.",GetName(playerid),playeridmedfee);
          
SendClientMessageToAll(COLOR_CYAN,string);
          
format(string2sizeof(string2), "You have died. The hospital has charged you $%d in medical fees.",medfee);
          
SendClientMessage(playeridCOLOR_CYANstring2);
    }
    else
    {
          new 
string2[500], string3[500];
          new 
wealth GetPlayerCash(playerid) + pInfo[playerid][pBankMoney];
          new 
medfee = (12*wealth)/100;
          
pInfo[playerid][pBankMoney] = pInfo[playerid][pBankMoney] - medfee;
          
format(stringsizeof(string), "%s (%d) has paid $%d in medical fees.",GetName(playerid),playeridmedfee);
          
SendClientMessageToAll(COLOR_CYAN,string);
          
format(string2sizeof(string2), "You have died. The hospital has charged you $%d in medical fees. You have used your bank account to paid your medical fees.",medfee);
          
SendClientMessage(playeridCOLOR_CYANstring2);
          
format(string3sizeof(string3), "Now, your total balance is: $%d",pInfo[playerid][pBankMoney]);
          
SendClientMessage(playeridCOLOR_CYANstring3);
    } 
Reply


Messages In This Thread
Medical fees - by STONEGOLD - 21.06.2015, 01:07
Re: Medical fees - by STONEGOLD - 21.06.2015, 01:38
Re: Medical fees - by Banana_Ghost - 21.06.2015, 05:06
Re: Medical fees - by Dusan01 - 21.06.2015, 08:28
Re: Medical fees - by STONEGOLD - 21.06.2015, 09:19
Re: Medical fees - by Dusan01 - 21.06.2015, 09:25
Re: Medical fees - by STONEGOLD - 21.06.2015, 10:04
Re: Medical fees - by Dusan01 - 21.06.2015, 10:17

Forum Jump:


Users browsing this thread: 1 Guest(s)