wanted colors
#1

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??
Reply
#2

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;
}
Reply
#3

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;
}
Reply
#4

how could i make for ex
if medic team is 1 the color will be purple for ex

medicteam[ playerid ] = 1;
Reply
#5

cmon any answares?
Reply
#6

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;
}
Reply
#7

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
:/
Reply
#8

That's what I did??
Reply
#9

thanks all
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)