Command
#1

Hey How To I can make this command such as If the player In jailed and the timer of jailed has ended the enemy players can bail this player and he can bail himself if he want! How to do that? Such as If the enemy player bail him They must send message to all players %s has bail the player of jailed %s like that. I've putting in the public when timer is ended a OtherMenu[playerid] = 1; but when I typing /bail ID the enemy player dose not leaving the jailed why? can u help me?

// In the public

PHP код:
if(pJailCount[playerid] == 0)
    {
        
BailPlayer[playerid] = 1;
        
SendClientMessage(playerid, -1"Jail Sentence served! Type {0080FF}/bail {FFFFFF}to get out.");
        
GameTextForPlayer(playerid"~B~/BAIL TO LEAVE ~R~JAILED"50005);
        
KillTimer(pJailTimerID[playerid]);
        
KillTimer(SendToJail[playerid]);
        
KillTimer(pJailCount[playerid]);
        
OtherMenuBail[id] = 1;
        return 
1;
    } 
Command is:
PHP код:
CMD:bail(playeridparams[]) 

    new 
idpName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],string[128]; 
    
GetPlayerName(playeridpNamesizeof(pName)); 
    
GetPlayerName(idtNamesizeof(tName)); 
    if(
sscanf(params"u"id)) return SendClientMessage(playerid, -1"{FF5044}USAGE: /bail [ID]"); 
    if(
PlayerInfo[id][pJailed] == 0) return SendClientMessage(playeridred"{FF0000}Error: This player is not in jail."); 
    if(
BailPlayer[playerid] == 1
    { 
               
MoneyForBail[playerid] = random(7000) + 1000
            if(
MoneyForBail[playerid] > GetPlayerCash(playerid)) 
               { 
                   
MoneyFor[playerid] = MoneyForBail[playerid]; 
                if(
GetPlayerMoney(playerid) < MoneyForBail[playerid]) return SendClientMessage(playeridCOLOR_RED"{FF0000}Error: {FFFFFF}You don't have engouh money to bail yourself."); 
                   
format(fstr2sizeof(fstr2), "{FFFFFF}[JAIL RELEASE]: {FFD700}%s(%d) {FFFFFF}has been released from {33FF33}Jail{FFFFFF}. Bail paid ({33FF33}$%d{FFFFFF})!"GetName(playerid),playeridMoneyForBail[playerid]); 
                
SendClientMessageToAll(COLOR_DODGERBLUEfstr2); 
                
BailPlayer[playerid] = 0
                
TextDrawHideForPlayer(playeridTextdraw0); 
                
TextDrawHideForPlayer(playeridTextdraw1); 
                
TextDrawHideForPlayer(playeridTextdraw2); 
                
TextDrawHideForPlayer(playeridTextdraw3); 
                
TextDrawHideForPlayer(playeridTextdraw9); 
                
KillTimer(pJailTimerID[playerid]); 
                 
KillTimer(SendToJail[playerid]); 
                
KillTimer(pJailCount[playerid]); 
                 
BeginArrested[playerid] = 0
                  
MoneyForBail[playerid] = 0
                
SetPlayerInterior(playerid3); 
                
PlayerInfo[playerid][pJailed] = 0
                
SetPlayerPos(playerid199.4501,169.1128,1003.0234); 
                
SetPlayerHealth(playerid100); 
                
GivePlayerMoney(playerid, -MoneyFor[playerid]); 
               } 
        } 
        else if(
OtherMenuBail[playerid] == 1
        { 
            if(
PlayerInfo[id][pJailed] == 0) return SendClientMessage(playeridred"{FF0000}Error: This player is not in jail."); 
            if(
MoneyForBail[playerid] > GetPlayerCash(id)) 
            { 
                  if(
GetPlayerMoney(id) < MoneyForBail[playerid]) 
                  { 
                      if(
PlayerInfo[id][pJailed] == 1
                      { 
                        
format(stringsizeof(string), "{FFFFFF}[JAIL RELEASE]: {FFD700}%s(%d) {FFFFFF}has been {00FF0C}PAYED {FFFFFF}a bail for enemy Player {FFD700}%s(%d){FFFFFF}. Bail Paid: ({33FF33}$%d{FFFFFF})!"tName,id,pName,playeridMoneyForBail[playerid]); 
                        
SendClientMessageToAll(COLOR_DODGERBLUEstring); 
                        
GivePlayerMoney(id, -MoneyFor[playerid]); 
                          
BailPlayer[playerid] = 0
                          
TextDrawHideForPlayer(playeridTextdraw0); 
                          
TextDrawHideForPlayer(playeridTextdraw1); 
                        
TextDrawHideForPlayer(playeridTextdraw2); 
                        
TextDrawHideForPlayer(playeridTextdraw3); 
                        
TextDrawHideForPlayer(playeridTextdraw9); 
                        
KillTimer(pJailTimerID[playerid]); 
                         
KillTimer(SendToJail[playerid]); 
                        
KillTimer(pJailCount[playerid]); 
                        
BeginArrested[playerid] = 0
                        
MoneyForBail[playerid] = 0
                        
SetPlayerInterior(playerid3); 
                        
PlayerInfo[playerid][pJailed] = 0
                        
SetPlayerPos(playerid199.4501,169.1128,1003.0234); 
                         
SetPlayerHealth(playerid100); 
                         
EnemyBail[id] = 0
                         
OtherMenuBail[id] = 0
                    } 
                    else 
                    { 
                        
SendClientMessage(playeridCOLOR_RED"{FF0000}Error: {FFFFFF}You don't have engouh money to bail enemy player."); 
                        return 
0
                    } 
                 } 
                 else 
                { 
                        
format(string,sizeof(string), "{00BDFF}[Jail]: [ERROR]: {FFFFFF}%s(%d) has not served their minimum Jail Sentence yet. {FFFFFF}Time left: {0080FF}%d{FFFFFF}."pName,playeridpJailCount[playerid]); 
                        
SendClientMessage(playerid, -1string); 
                        return 
0
                } 
            } 
        } 
    return 
1

Reply
#2

You need to set the spawn when the player already reached the jail time. You need to put this in the public.
SetPlayerInterior(playerid, 0); to set it back. But i don't understand what you are saying but i can understand some of it.
Reply
#3

I speak for example that I am in prison and someone wants to pay bail to me and the sponsorship is defended by the person must send a message to all players as! How?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)