[Ajuda] ME ajuda com cores pra admin - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] ME ajuda com cores pra admin (
/showthread.php?tid=391764)
ME ajuda com cores pra admin -
rogerioexper - 11.11.2012
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;
}
Re: ME ajuda com cores pra admin -
humildadeforever - 11.11.2012
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;
}
Re: ME ajuda com cores pra admin - rjjj - 11.11.2012
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

.
Re: ME ajuda com cores pra admin -
rogerioexper - 11.11.2012
vlw ae mais rp