[Ajuda] ME ajuda com cores pra admin
#1

nAO SEI SE TA CERTO ISSO AI MAIS QUERO POR PRA QUANDO OS ADM ENTRAR JA SETAA COR DELES VLW MAIS RP
SetTimer("CoresAdmin",10000,true);
PHP код:
ONGAMEMODEINIT
    SetTimer
("CoresAdmin",10000,true);
forward CoresAdmin(playerid);
public 
CoresAdmin(playerid)
{
   if(
PlayerInfo[playerid][pAdmin] == 1)
   
SetPlayerColor(playerid,0xE39B14FF);
   if(
PlayerInfo[playerid][pAdmin] == 2)
   
SetPlayerColor(playerid,0x07F753FF);
   if(
PlayerInfo[playerid][pAdmin] == 3)
   
SetPlayerColor(playerid,0x62639EFF);
   if(
PlayerInfo[playerid][pAdmin] == 4)
   
SetPlayerColor(playerid,0x0A0EF2FF);
   if(
PlayerInfo[playerid][pAdmin] == 5)
   
SetPlayerColor(playerid,0xF578F5FF);
   if(
PlayerInfo[playerid][pAdmin] == 3000)
   
SetPlayerColor(playerid,0x12DBE6FF);
   if(
PlayerInfo[playerid][pAdmin] == 4000)
   
SetPlayerColor(playerid,COLOR_YELLOW);
   if(
PlayerInfo[playerid][pAdmin] == 5000)
   
SetPlayerColor(playerid,0xB30EA8FF);
   return 
1;

Reply
#2

Da forma que vocк fez, terб que usar SetTimerEx na OnPlayerConnect/OnPlayerSpawn ou no Login.
Ou vocк pode usar SetTimer na OnGameModeInit e usar assim:
Код:
forward CoresAdmin(); 
public CoresAdmin() 
{ 
  for(new x = 0; x < MAX_PLAYERS; x++)
  {
        if(PlayerInfo[x][pAdmin] == 1) 
        SetPlayerColor(x, 0xE39B14FF); 
        if(PlayerInfo[x][pAdmin] == 2) 
        SetPlayerColor(x,0x07F753FF); 
        if(PlayerInfo[x][pAdmin] == 3) 
        SetPlayerColor(x,0x62639EFF); 
        if(PlayerInfo[x][pAdmin] == 4) 
        SetPlayerColor(x,0x0A0EF2FF); 
        if(PlayerInfo[x][pAdmin] == 5) 
        SetPlayerColor(x0xF578F5FF); 
        if(PlayerInfo[x][pAdmin] == 3000) 
        SetPlayerColor(x,0x12DBE6FF); 
        if(PlayerInfo[x][pAdmin] == 4000) 
        SetPlayerColor(x,COLOR_YELLOW); 
        if(PlayerInfo[x][pAdmin] == 5000) 
        SetPlayerColor(x,0xB30EA8FF); 
   }  
   return 1; 
}
Reply
#3

Isto deve resolver o seu problema :


pawn Код:
SetTimer("CoresAdmin", 1000, true);

pawn Код:
forward CoresAdmin();
public CoresAdmin()
{
    static Cores[] =
    {
        0xE39B14FF,
        0x07F753FF,
        0x62639EFF,
        0x0A0EF2FF,
        0xF578F5FF,
        0x12DBE6FF,
        0xFFFF00AA,
        0xB30EA8FF
    };
    for(new x = 0, y = GetMaxPlayers(); x != y; x++)
    {
        if(!IsPlayerConnected(x)) continue;
        switch(PlayerInfo[x][pAdmin])
        {
            case 1..5:  SetPlayerColor(x, Cores[PlayerInfo[x][pAdmin] - 1]);
            case 3000, 4000, 5000:  SetPlayerColor(x, Cores[PlayerInfo[x][pAdmin] / 1000 + 2]);
        }
    }
    return 1;
}


Espero ter ajudado .
Reply
#4

vlw ae mais rp
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)