[Ajuda] Patente - 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] Patente (
/showthread.php?tid=447422)
Patente -
Gleisson_. - 29.06.2013
Gostaria de saber por que nгo estб atualizando as patente:
Cуdigo:
pawn Код:
stock GetarRank(playerid)
{
new NomeRank[30];
if(PlayerDados[playerid][Level] == 0) { NomeRank = "Novato"; }
if(PlayerDados[playerid][Level] == 1) { NomeRank = "Recruta"; }
if(PlayerDados[playerid][Level] == 2) { NomeRank = "Soldado"; }
if(PlayerDados[playerid][Level] == 3) { NomeRank = "Cabo"; }
if(PlayerDados[playerid][Level] == 4) { NomeRank = "Sargento"; }
return NomeRank;
}
Forward pбra atualizar:
pawn Код:
forward Atualizar(); public Atualizar()
{
new PatentesDoDioner[128];
format(PatentesDoDioner, 128, "~g~~h~ ~>~Ranking~<~~n~~h~ %s", GetarRank(x));
TextDrawSetString(Patentes, PatentesDoDioner);
TextDrawShowForPlayer(x, Patentes);
return 1;
}
Re: Patente -
Rodney Francalim - 29.06.2013
pawn Код:
forward Atualizar(); public Atualizar()
{
new
PatentesDoDioner[ 128 ];
for( new x = 0; x < MAX_PLAYERS; x++ )
{
format( PatentesDoDioner, 128, "~g~~h~ ~>~Ranking~<~~n~~h~ %s", GetarRank( x ));
TextDrawSetString( Patentes, PatentesDoDioner );
TextDrawShowForPlayer( x, Patentes );
}
return 1;
}
Re: Patente -
Gleisson_. - 29.06.2013
Quote:
Originally Posted by Rodney Francalim
pawn Код:
forward Atualizar(); public Atualizar() { new PatentesDoDioner[ 128 ];
for( new x = 0; x < MAX_PLAYERS; x++ ) { format( PatentesDoDioner, 128, "~g~~h~ ~>~Ranking~<~~n~~h~ %s", GetarRank( x )); TextDrawSetString( Patentes, PatentesDoDioner ); TextDrawShowForPlayer( x, Patentes ); } return 1; }
|
Sim isso ja tem mais ele nгo atualiza corretamente, ele vai de novato para soldado..
Re: Patente -
[THs]ShadoW - 29.06.2013
Quote:
Originally Posted by Gleisson_.
Sim isso ja tem mais ele nгo atualiza corretamente, ele vai de novato para soldado..
|
O PlayerDados[playerid][Level] й igual ao GetPlayerScore ?
Re: Patente -
Gleisson_. - 29.06.2013
Quote:
Originally Posted by [THs]ShadoW
O PlayerDados[playerid][Level] й igual ao GetPlayerScore ?
|
Nгo.
Re: Patente -
Gustavo_Carvalho - 29.06.2013
Vocк estб usando SetTimer ou SetTimerEx?
Re: Patente -
Gleisson_. - 30.06.2013
Quote:
Originally Posted by Gustavo_Carvalho
Vocк estб usando SetTimer ou SetTimerEx?
|
Que que tem a ver mano ¬¬
Re: Patente -
Gustavo_Carvalho - 30.06.2013
Se vocк estiver usando SetTimer com playerid no lugar de SetTimerEx, vai bugar o textdraw para todos do servidor.
Simples, ignorante.
Re: Patente -
StrondA_ - 30.06.2013
Se nгo conseguir resolver agora, desiste. rs!
pawn Код:
new Text:Patentes[MAX_PLAYERS]; // Textdraw Global
public OnGameModeInit()
{
for(new i; i<MAX_PLAYERS; i++)
{
Patentes[i] = TextDrawCreate...
}
return true;
}
stock GetarRank(playerid)
{
switch (PlayerDados[playerid][Level])
{
case 0: NomeRank = "Novato";
case 1: NomeRank = "Recruta";
case 2: NomeRank = "Soldado";
case 3: NomeRank = "Cabo";
case 4: NomeRank = "Sargento";
}
return true;
}
forward Atualizar();
public Atualizar()
{
new string[50];
for(new i; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i))
{
format(string, 50, "~g~~h~ ~>~Ranking~<~~n~~h~ %s", GetarRank(i));
TextDrawSetString(Patentes[i], string), TextDrawShowForPlayer(i, Patentes[i]);
}
return true;
}