Same amount!
#3

stores the money in a variable.

PHP Code:

new MoneyForBail[MAX_PLAYERS]; // global variable, reset at OnPlayerConnect
if(BailPlayer[playerid] == 1
    {
        
MoneyForBail[playerid] = random(7000) + 1000
        if(
MoneyForBail[playerid] > GetPlayerCash(playerid)) 
        { 
            if(
GetPlayerMoney(playerid) < MoneyForBail[playerid]) return SendClientMessage(playeridCOLOR_RED"{FF0000}Error: {FFFFFF}You don't have engouh money to bail yourself.");
      ....
            
            
forward pJailTimer(playerid); 
public 
pJailTimer(playerid

    
RemovePlayerAttachedObject(playerid9); 
    
SetPlayerSpecialAction(playeridSPECIAL_ACTION_NONE); 
    
PlayerInfo[playerid][pJailed] = 1
    
pJailCount[playerid]--; 
    new 
string[128]; 
    
format(stringsizeof(string), "%d"pJailCount[playerid]); 
    
TextDrawSetString(Textdraw1string); 
    
format(stringsizeof(string), "$%d"MoneyForBail[playerid]);
    ...
    
MoneyForBail[playerid] = 0
Reply


Messages In This Thread
Same amount! - by Man43 - 25.07.2018, 07:38
Re: Same amount! - by Man43 - 25.07.2018, 09:43
Re: Same amount! - by Florin48 - 25.07.2018, 10:02
Re: Same amount! - by Man43 - 25.07.2018, 12:13
Re: Same amount! - by Florin48 - 25.07.2018, 12:21

Forum Jump:


Users browsing this thread: 1 Guest(s)