How to
#7

this is full command

PHP код:
CMD:bail(playeridparams[])
{
    new 
pName[MAX_PLAYER_NAME],tName[MAX_PLAYER_NAME],targetid;
    new 
string[128];
    
GetPlayerName(playeridpNamesizeof(pName));
    
GetPlayerName(targetidtNamesizeof(tName));
    if(
sscanf(params"u"playerid)) return SendClientMessage(playeridCOLOR_WHITE"{FF0000}Error: /Bail <playerid>"); //should be targetid, not playerid
    
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, -1"{FF0000}Error: {FFFFFF}Invaild Player.");
    if(
PlayerInfo[playerid][pJailed] == 0) return SendClientMessage(playeridred"{FF0000}Error: This player is not in jail.");
    
PayTheJail[targetid] = playerid;
    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.");
            if(
targetid == playerid)
            {
                
format(fstr2sizeof(fstr2), "{FFFFFF}[JAIL RELEASE]: {FFD700}%s(%d) {FFFFFF}has been released from {33FF33}Jail{FFFFFF}. Bail paid ({33FF33}$%d{FFFFFF})!"pName,playeridMoneyForBail[playerid]);
                
SendClientMessageToAll(COLOR_DODGERBLUEfstr2);
            }
            else
            {
                  
format(string,sizeof(string),"{3DB9E7}[Confinement Payment]: {FFFFFF}Player {3DB9E7}%s(%d) {FFFFFF}has PAID the bail of the jailed to {3DB9E7}%s(%d). {FFFFFF}Bail Was: {36FF00}$%d{FFFFFF}!",pName,playerid,tName,targetid,MoneyForBail[playerid]);
                
SendClientMessageToAll(COLOR_DODGERBLUEstring);
            }
            
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, -MoneyForBail[playerid]);
            
GivePlayerMoney(targetid, -MoneyForBail[playerid]);
        }
    }
    return 
1;

Example: I just want If someone typing /bail [ID] and the player got released from jailed by a player they must saying %s has paid do you understand me? and If the player payed himself It's worked.. Just the player if bailed other players not worked why?
Reply


Messages In This Thread
How to - by Thanks - 11.08.2018, 01:12
Re: How to - by Dangjai - 11.08.2018, 01:16
Re: How to - by Thanks - 11.08.2018, 01:17
Re: How to - by Dangjai - 11.08.2018, 01:19
Re: How to - by Thanks - 11.08.2018, 01:24
Re: How to - by TVDude - 11.08.2018, 02:56
Re: How to - by Thanks - 11.08.2018, 13:22
Re: How to - by Thanks - 11.08.2018, 19:42
Re: How to - by KinderClans - 11.08.2018, 19:44
Re: How to - by Thanks - 11.08.2018, 19:46

Forum Jump:


Users browsing this thread: 2 Guest(s)