21.06.2015, 08:28
Try this code:
I think problem was u are taking player money from hand + from bank in both cases
Код:
if(pInfo[playerid][pBankMoney] < 50000) { new string2[500]; new wealth = GetPlayerCash(playerid); new medfee = (12*wealth)/100; GivePlayerCashEx(playerid,-medfee); format(string, sizeof(string), "%s (%d) has paid $%d in medical fees.",GetName(playerid),playerid, medfee); SendClientMessageToAll(COLOR_CYAN,string); format(string2, sizeof(string2), "You have died. The hospital has charged you $%d in medical fees.",medfee); SendClientMessage(playerid, COLOR_CYAN, string2); } else if(pInfo[playerid][pBankMoney] >= 50000) { new string2[500], string3[500]; new wealth = pInfo[playerid][pBankMoney]; new medfee = (12*wealth)/100; pInfo[playerid][pBankMoney] -= medfee; format(string, sizeof(string), "%s (%d) has paid $%d in medical fees.",GetName(playerid),playerid, medfee); SendClientMessageToAll(COLOR_CYAN,string); format(string2, sizeof(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(playerid, COLOR_CYAN, string2); format(string3, sizeof(string3), "Now, your total balance is: $%d",pInfo[playerid][pBankMoney]); SendClientMessage(playerid, COLOR_CYAN, string3); }