SA-MP Forums Archive
need help with a command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: need help with a command (/showthread.php?tid=180962)



need help with a command - LegendNissanGTR - 03.10.2010

HI Guys Again,
how do i make a command for cops when they do /parole [id] they release the players from jail and how to make a command for like when the robber do /bribe [id] [amount] then he put like 15k cash to the cop then his wanted stars are gone please help ,thanks


Re: need help with a command - randomkid88 - 03.10.2010

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:

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;
}
And for the bribe:

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;
}
And these are semi-basic versions, you should be able to easily modify them if you know what you're doing.