In-game Colors?
#1

Right so i dont know how to do this (this is the whole point of learning) but this is what i want
people with 6 stars = Red Name
People with 0 stars = white name
class id 2 (team whatever) = blue
how can i do this?
Reply
#2

pawn Код:
public OnPlayerRequestClass( playerid, classid ) {
    if( classid == 2 ) SetPlayerColor( playerid, 0x0000BBAA );
    return 1;
}

public OnPlayerUpdate( playerid ) {
    if( GetPlayerWantedLevel( playerid ) >= 0 && GetPlayerWantedLevel( playerid ) <= 5 ) SetPlayerColor( playerid, 0xFFFFFFAA );
    else if( GetPlayerWantedLevel( playerid ) > 5 ) SetPlayerColor( playerid, 0x800000AA );
    return 1;
}
Reply
#3

cop dont work as they have no stars? anyway around this?
Reply
#4

bump.
Reply
#5

pawn Код:
public OnPlayerUpdate( playerid ) {
    if(GetPlayerSkin(playerid) != COPSKINID)
    {
        if( GetPlayerWantedLevel( playerid ) >= 0 && GetPlayerWantedLevel( playerid ) <= 5 ) SetPlayerColor( playerid, 0xFFFFFFAA );
        else if( GetPlayerWantedLevel( playerid ) > 5 ) SetPlayerColor( playerid, 0x800000AA );
    }
    return 1;
}
Replace the COPSKINID with the skin (not the class) id of cops (280?)
Reply
#6

pawn Код:
public OnPlayerUpdate( playerid ) {
    if(GetPlayerSkin(playerid) != 265 && GetPlayerSkin(playerid) != 266 && GetPlayerSkin(playerid) != 267 && GetPlayerSkin(playerid) != 280 && GetPlayerSkin(playerid) != 281)
            {
            // checks if player wanted level is bigger then 6
            if(GetPlayerWantedLevel(playerid) >= 6)
                   {
                   // replace the ColorCode with your color....(0x667788 or somthing like thet..)
                   SetPlayerColor(playerid, ColorCode);
                   }
            // we still didnt close it... we want to keep with it :)
            // Check if the player wanted level is bigger then 0 and smaller then 5
            // now y 5 and not 6? caz we have ' <= ' and not just ' < '
            // <=  means then the number smaller or equal to the number, so if we will put 6 it will give as a crash or somthing like thet...
            if(GetPlayerWantedLevel(playerid) >= 0 && GetPlayerWantedLevel(playerid) <= 5)
                   {
                   // replace the ColorCode with your color....(0x667788 or somthing like thet..)
                   SetPlayerColor(playerid, ColorCode);
            }
Reply
#7

Quote:
Originally Posted by phil_lendon
Посмотреть сообщение
Right so i dont know how to do this (this is the whole point of learning) but this is what i want
people with 6 stars = Red Name
People with 0 stars = white name
class id 2 (team whatever) = blue
how can i do this?
pawn Код:
public OnPlayerUpdate(playerid)
{
     if (GetPlayerWantedLevel(playerid) >= 6 && GetPlayerTeam(playerid) == 1) { SetPlayerColor(playerid, 0xFF0000FF); }
     else if (GetPlayerWantedLevel(playerid) < 6 && GetPlayerTeam(playerid) == 1) { SetPlayerColor(playerid, 0xFFFFFFFF); }
     return true.
}

public OnPlayerSpawn(playerid)
{
     if (GetPlayerTeam(playerid) == 1) { SetPlayerColor(playerid, 0xFFFFFFFF); }
     else if (GetPlayerTeam(playerid) == 2) { SetPlayerColor(playerid, 0x00CCFFFF); }
     return true.
}
+I don't recommend using onplayerupdate thoug.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)