02.02.2012, 15:13
pawn Code:
COMMAND:arrest(playerid, params[])
{
stunedid = strval(params);
if(gTeam[playerid] == TEAM_ENFORCERS)
{
if (strval(params)>0)
{
if (Stuned[stunedid] == 1)
{
new rand = random(sizeof(JAIL));
SetPlayerScore(stunedid,GetPlayerScore(stunedid)-10);
GivePlayerMoney(stunedid,-1000);
SetPlayerPos(stunedid, JAIL[rand][0],JAIL[rand][1],JAIL[rand][2]);
SetCameraBehindPlayer(stunedid);
SendClientMessage(stunedid,COLOR_GREY,"* You have been arrested! You lost 10000$ and 10 Score");
GameTextForPlayer(stunedid,"~r~ARRESTED!",3000,3);
SetPlayerScore(playerid,GetPlayerScore(playerid)+10);
GivePlayerMoney(playerid,10000);
SendClientMessage(playerid,COLOR_GREY,"* You arrested Criminal and received 10000$ and 10 Score");
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: That player is not stunned!");
}
else SendClientMessage(playerid, COLOR_RED, "Usage: /arrest <stuned-playerid>");
}
else SendClientMessage(playerid, COLOR_RED, "ERROR: Only Enforcers can use this command!");
return 1;
}