I need a help - 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)
+--- Thread: I need a help (
/showthread.php?tid=437336)
I need a help -
Latisha - 15.05.2013
Hello,
I need scripts to make a Most Wanted Suspect has a checkpoint on his self?
can someone help me?
Re: I need a help - Emmet_ - 15.05.2013
Something like this should work:
pawn Код:
new bool:Marker[MAX_PLAYERS];
public OnGameModeInit()
{
SetTimer("CheckWanted", 2000, true);
return 1;
}
forward CheckWanted();
public CheckWanted()
{
for (new i = 0; i < MAX_PLAYERS; i ++)
{
if (!IsPlayerConnected(i)) continue;
if (GetPlayerWantedLevel(i) == 6)
{
// The player's color will be set and other players can see it on their radar.
SetPlayerColor(i, 0xFF0000FF);
Marker[i] = true;
}
else
{
if (Marker[i])
{
SetPlayerColor(i, 0xFFFFFFAA);
Marker[i] = false;
}
}
}
return 1;
}
Re: I need a help -
Latisha - 15.05.2013
SetTimer("CheckWanted", 2000, true);
what's timer for?
Re: I need a help -
RajatPawar - 15.05.2013
To execute the check wanted function every two seconds!