wanted colors - 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: wanted colors (
/showthread.php?tid=375914)
wanted colors -
HardBoy - 08.09.2012
hey
how could i make for ex:
if someone have 1-3 stars he auto gets yellow color
if someone have 4-6 stars he auto gets red color
and when his wanted remove to 0 he becomes auto white
how
??
Re: wanted colors -
Djole1337 - 08.09.2012
Here you go:
pawn Код:
forward WantedLevelColor(playerid);
public WantedLevelColor(playerid) {
new wanted = GetPlayerWantedLevel(playerid);
if(wanted == 6)
{
SetPlayerColor(playerid, COLOR_RED);
}
if(wanted == 5)
{
SetPlayerColor(playerid, COLOR_RED);
}
if(wanted == 4)
{
SetPlayerColor(playerid, COLOR_RED);
}
if(wanted == 3)
{
SetPlayerColor(playerid, COLOR_YELLOW);
}
if(wanted == 2)
{
SetPlayerColor(playerid, COLOR_YELLOW);
}
if(wanted == 1)
{
SetPlayerColor(playerid, COLOR_YELLOW);
}
if(wanted == 0)
{
SetPlayerToTeamColor(playerid);
}
return true;
}
public OnPlayerUpdate(playerid)
{
WantedLevelColor(playerid);
return true;
}
Re: wanted colors -
Lordzy - 08.09.2012
Here you go.
pawn Код:
//Using zcmd include also.
#include <a_samp>
#include <zcmd>
#define red 0xFF0000
#define white 0xFFFFFF
#define yellow 0xCAFF70
public OnPlayerUpdate(playerid)
{
if(GetPlayerWantedLevel(playerid)==0)
{
SetPlayerColor(playerid,white);
}
if(GetPlayerWantedLevel(playerid)>=1)
{
SetPlayerColor(playerid,yellow);
}
if(GetPlayerWantedLevel(playerid)>=4);
{
SetPlayerColor(playerid,red);
}
return 1;
}
Re: wanted colors -
HardBoy - 08.09.2012
how could i make for ex
if medic team is 1 the color will be purple for ex
medicteam[ playerid ] = 1;
Re: wanted colors -
HardBoy - 08.09.2012
cmon any answares?
Re: wanted colors -
clarencecuzz - 08.09.2012
pawn Код:
#include <a_samp>
#define red 0xFF0000FF
#define purple 0x4B00B0FF
#define white 0xFFFFFFFF
#define yellow 0xFF0000FF
public OnFilterScriptInit() //Or OnGameModeInit() if you're using a gamemode.
{
SetTimer("ColorCheck", 1000, true);
return 1;
}
forward ColorCheck();
public ColorCheck()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(medicteam[i] == 1)
{
SetPlayerColor(i, purple);
}
else
{
switch(GetPlayerWantedLevel(i))
{
case 0:
{
SetPlayerColor(i, white);
}
case 1 .. 3:
{
SetPlayerColor(i, yellow);
}
case 4 .. 6:
{
SetPlayerColor(i, red);
}
}
}
}
}
return 1;
}
Re: wanted colors -
HardBoy - 08.09.2012
clar i didnt mean that i ment
if player had medic team and he had 0 wanted he be purble
and if civilian andd 0 wanted he be white
:/
Re: wanted colors -
clarencecuzz - 08.09.2012
That's what I did??
Re: wanted colors -
HardBoy - 08.09.2012
thanks all