03.10.2010, 15:51
As far as the /parole, it depends on how you jail them. I assume you have a Player Info enum and one of the items is "jailed" or "pJailed" or something like that. This might not work for yours exactly copy and paste, but this is a general guideline:
And for the bribe:
And these are semi-basic versions, you should be able to easily modify them if you know what you're doing.
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(parole, 6, cmdtext);
}
dcmd_parole(playerid, params[])
{
new id;
if (sscanf(params, "d", id)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /parole [id]");
else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, 0xFF0000AA, "Player is not connected or is yourself");
else if(PlayerInfo[id][pJailed] == 0) SendClientMessage(playerid, 0xFF0000AA, "Player is not in jail!"
else
{
PlayerInfo[id][pJailed] = 0;
SetPlayerPos(id, x, y, z); //These are the coordinates of where you want them to go when released from jail
SendClientMessage(id, 0x00FF00AA, "You have been released from jail on parole");
}
return 1;
}
pawn Код:
OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(bribe, 5, cmdtext);
}
dcmd_bribe(playerid, params[])
{
new id, amt, cash;
if(sscanf(params, "dd", id, amt)) SendClientMessage(playerid, 0xFF0000AA, "Usage: /bribe [id] [amount]");
else if(GetPlayerMoney(playerid) < amt) SendClientMessage(playerid, 0xFF0000AA, "You do not have enough money to bribe this amount!");
else
{
GivePlayerMoney(id, amt);
GivePlayerMoney(playerid, -amt);
SendClientMessage(id, 0x00ff00aa, "You have been bribed!");
}
return 1;
}