07.08.2018, 18:41
Hi How To I can make /bail [ID] Example: If there someone his time of jail is finished and he don't have engouh money to pay the bail.. And someone bail him they message send to All players a messages a Example: Tracking(5) has bailed the jail amount of the player Track(1) How? I've creating a command but I don't even know how to creating this factions...
PHP код:
CMD:bail(playerid, params[])
{
new pName[MAX_PLAYER_NAME],targetid;
GetPlayerName(playerid, pName, sizeof(pName));
if(sscanf(params, "u", playerid)) return SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Error: /Bail <playerid>");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, RED, "Player not found.");
if(PlayerInfo[playerid][pJailed] == 0) return SendClientMessage(playerid, red, "{FF0000}Error: This player is not in jail.");
if(BailPlayer[playerid] == 1)
{
MoneyForBail[playerid] = random(7000) + 1000;
if(MoneyForBail[playerid] > GetPlayerCash(playerid))
{
if(GetPlayerMoney(playerid) < MoneyForBail[playerid]) return SendClientMessage(playerid, COLOR_RED, "{FF0000}Error: {FFFFFF}You don't have engouh money to bail yourself.");
BailPlayer[playerid] = 0;
format(fstr, sizeof(fstr), "[DISPATCH]: Suspect %s[%d) has bail himself.", pName, playerid);
CopRadio(COLOR_DODGERBLUE, fstr);
format(fstr2, sizeof(fstr2), "{FFFFFF}[JAIL RELEASE]: {FFD700}%s(%d) {FFFFFF}has been released from {33FF33}Jail{FFFFFF}. Bail paid ({33FF33}$%d{FFFFFF})!", pName,playerid, MoneyForBail[playerid]);
SendClientMessageToAll(COLOR_DODGERBLUE, fstr2);
TextDrawHideForPlayer(playerid, Textdraw0);
TextDrawHideForPlayer(playerid, Textdraw1);
TextDrawHideForPlayer(playerid, Textdraw2);
TextDrawHideForPlayer(playerid, Textdraw3);
TextDrawHideForPlayer(playerid, Textdraw9);
KillTimer(pJailTimerID[playerid]);
KillTimer(SendToJail[playerid]);
KillTimer(pJailCount[playerid]);
BeginArrested[playerid] = 0;
MoneyForBail[playerid] = 0;
SetPlayerInterior(playerid, 3);
PlayerInfo[playerid][pJailed] = 0;
SetPlayerPos(playerid, 199.4501,169.1128,1003.0234);
SetPlayerHealth(playerid, 100);
GivePlayerMoney(playerid, -MoneyForBail[playerid]);
}
}
return 1;
}