Arrest,pull over,and wanted level 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: Arrest,pull over,and wanted level command. (
/showthread.php?tid=92244)
Arrest,pull over,and wanted level command. -
craponnaruto - 19.08.2009
I need to know how to make a script so that if a civilian with no wanted level does something illegal*ex:robs a bank*gets a higher wanted level.
Re: Illegal script*for cops and robbers* -
MenaceX^ - 19.08.2009
More info, define how the players get wanted level or what ever you need.
Re: Illegal script*for cops and robbers* -
craponnaruto - 19.08.2009
I need a script so when a civilian does something illegal,his wanted level raises.Then a cop is able to pull him over.But if he is at a 5 star wanted level,he can be arrested.But if he doesn't have any wanted level he can't be pulled over or arrested.
Wanted Level = the stars on your screen
Re: Illegal script*for cops and robbers* -
Kyle - 19.08.2009
Put this in when he does somthing illegal
SetPlayerWantedLevel(playerid,12);
Re: Illegal script*for cops and robbers* -
craponnaruto - 19.08.2009
Now what would be the script so that if they're wanted level is 1-4 they can get pulled over and issued a ticket.
Re: Illegal script*for cops and robbers* -
Kyle - 19.08.2009
Use common sence.
wanted = GetPlayerWantedLevel(playerid);
SetPlayerWantedLevel(playerid, wanted+2);
I Think
Re: Illegal script*for cops and robbers* -
CAR - 19.08.2009
how many levels is 1 star?
Re: Illegal script*for cops and robbers* -
Kyle - 19.08.2009
4 ithink
Re: Illegal script*for cops and robbers* -
Calgon - 19.08.2009
Near the top:
pawn Код:
new DEFINED_ROBBERY_AMOUNT = "69"
new WantedPlayer[MAX_PLAYERS];
pawn Код:
if (strcmp(cmd, "/robbank", true) == 0)
{
new wantedpl[MAX_PLAYER_NAME];
GetPlayerName(playerid, wantedpl, sizeof(wantedpl));
if(WantedPlayer[playerid] == 0)
{
format(string, sizeof(string), "%s has become a criminal, the player is at 1 star! Catch them!", wantedpl);
SendClientMessageToAll(0xFFFFFFAA, string);
WantedPlayer[playerid]++;
SetPlayerWantedLevel(playerid, 1);
GivePlayerMoney(playerid, DEFINED_ROBBERY_AMOUNT);
}
else if (WantedPlayer[playerid] >= 1 && WantedPlayer[playerid] < 6)
{
WantedPlayer[playerid]++;
SetPlayerWantedLevel(playerid, WantedPlayer[playerid]);
GivePlayerMoney(playerid, DEFINED_ROBBERY_AMOUNT);
format(string, sizeof(string), "%s has obtained another star, catch them! (Now at %d).", wantedpl, WantedPlayer[playerid]);
SendClientMessageToAll(0xFFFFFFAA, string);
}
else if(WantedPlayer[playerid] >= 6)
{
SendClientMessage(playerid, 0xFFFFFFAA, "You're the most wanted, run run run!");
}
}
OnPlayerDeath:
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
new murderedname[MAX_PLAYER_NAME];
new murderersname[MAX_PLAYER_NAME];
if(WantedPlayer[playerid] > 0)
{
GetPlayerName(playerid, murderedname, sizeof(murderedname));
GetPlayerName(killerid, murderersname, sizeof(murderers));
format(string, sizeof(string), "%s has slaughtered the Wanted Criminal %s.", murderersname, murderedname);
SendClientMessageToAll(0xFFFFFFAA, string);
}
}
Have fun.
Re: Illegal script*for cops and robbers* -
craponnaruto - 19.08.2009
Thanks