SA-MP Forums Archive
[Ajuda] AtualizarS - 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] AtualizarS (/showthread.php?tid=618874)



AtualizarS - FalcaoNC - 10.10.2016

@RESOLVIDO.


Re: AtualizarS - ClaudineiCDS - 10.10.2016

Vocк quer que a textdraw mostre os leveis de cada player?


Re: AtualizarS - FalcaoNC - 10.10.2016

Quote:
Originally Posted by ClaudineiCDS
Посмотреть сообщение
Vocк quer que a textdraw mostre os leveis de cada player?
Sim tenho atй pronta...

Код:
	for(new x = 0; x < MAX_PLAYERS; x++)
	{
		ScoreTextDraw[playerid] = CreatePlayerTextDraw(playerid, 608.118164, 33.666656, "LEVEL 99");
		PlayerTextDrawLetterSize(playerid, ScoreTextDraw[playerid], 0.280941, 1.290833);
		PlayerTextDrawAlignment(playerid, ScoreTextDraw[playerid], 3);
		PlayerTextDrawColor(playerid, ScoreTextDraw[playerid], -1);
		PlayerTextDrawSetShadow(playerid, ScoreTextDraw[playerid], 0);
		PlayerTextDrawSetOutline(playerid, ScoreTextDraw[playerid], 1);
		PlayerTextDrawBackgroundColor(playerid, ScoreTextDraw[playerid], 255);
		PlayerTextDrawFont(playerid, ScoreTextDraw[playerid], 2);
		PlayerTextDrawSetProportional(playerid, ScoreTextDraw[playerid], 1);
		PlayerTextDrawSetShadow(playerid, ScoreTextDraw[playerid], 0);
	}
Obs: Jб coloquei, estava em all, mas coloquei em playertext, e comeзar dar a warning.


Re: AtualizarS - s4kuL - 10.10.2016

Troque TextDrawShowForPlayer por PlayerTextDrawShow
E troque tambйm TextDrawSetString por PlayerTextDrawSetString

pawn Код:
forward AtualizarScore();
public AtualizarScore()
{
    for(new x = 0, y = GetMaxPlayers(); x != y; x++)
    {
        if(!IsPlayerConnected(x)) continue;
        new STR[26];
        format(STR, 26, "~w~Level: ~w~%d", GetPlayerScore(x));
        PlayerTextDrawShow(x, ScoreTextDraw[x]);
    PlayerTextDrawSetString(x, ScoreTextDraw[x], STR);
    }
    return true;
}



Re: AtualizarS - FalcaoNC - 10.10.2016

Quote:
Originally Posted by s4kuL
Посмотреть сообщение
Troque TextDrawShowForPlayer por PlayerTextDrawShow
E troque tambйm TextDrawSetString por PlayerTextDrawSetString
Код:
warning 213: tag mismatch
error 035: argument type mismatch (argument 2)
LINHA:

Код:
		PlayerTextDrawSetString(ScoreTextDraw[x], STR);



Re: AtualizarS - ClaudineiCDS - 10.10.2016

@Edit
Desse jeito que vc postou irб ficar mt ruim irб fazer loop td hr sem necessidade.
Tente ai
PHP код:
new
    
PlayerText:ScoreTextDraw[MAX_PLAYERS],
    
PlayerText:MostrarLevel[MAX_PLAYERS]
;
public 
OnPlayerConnect(playerid)
{
    
ScoreTextDraw[playerid] = CreatePlayerTextDraw(playerid608.11816433.666656"LEVEL 99");
    
PlayerTextDrawLetterSize(playeridScoreTextDraw[playerid], 0.2809411.290833);
    
PlayerTextDrawAlignment(playeridScoreTextDraw[playerid], 3);
    
PlayerTextDrawColor(playeridScoreTextDraw[playerid], -1);
    
PlayerTextDrawSetShadow(playeridScoreTextDraw[playerid], 0);
    
PlayerTextDrawSetOutline(playeridScoreTextDraw[playerid], 1);
    
PlayerTextDrawBackgroundColor(playeridScoreTextDraw[playerid], 255);
    
PlayerTextDrawFont(playeridScoreTextDraw[playerid], 2);
    
PlayerTextDrawSetProportional(playeridScoreTextDraw[playerid], 1);
    
PlayerTextDrawSetShadow(playeridScoreTextDraw[playerid], 0);
    
    
MostrarLevel[playerid] = SetTimerEx("AtualizarScore"10000true"i"playerid); //Coloquei para atualizar de 10 em 10 seg.
    
return 1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
KillTimer(MostrarLevel[playerid]);
    return 
1;
}
forward AtualizarScore(playerid);
public 
AtualizarScore(playerid)
{
    static 
str[90];
    
format(strsizeof str"~w~Level: ~w~%d"GetPlayerScore(playerid));
    
TextDrawShowForPlayer(playeridScoreTextDraw[playerid]);
    
TextDrawSetString(ScoreTextDraw[playerid], str);
    return 
1;




Re: AtualizarS - s4kuL - 10.10.2016

Quote:
Originally Posted by FalcaoNC
Посмотреть сообщение
Код:
warning 213: tag mismatch
error 035: argument type mismatch (argument 2)
LINHA:

Код:
		PlayerTextDrawSetString(ScoreTextDraw[x], STR);
Editei a minha resposta, vк ai!
e tambйm, o jeito que o ClaudineiCDS disse ai, й melhor mesmo..


Re: AtualizarS - F1N4L - 10.10.2016

Vai continuar dando warning, pois as variбveis TextDraw devem ser definidas assim:
Код:
//Global
new 
    Text:ScoreTextDraw[MAX_PLAYERS], 
    Text:MostrarLevel[MAX_PLAYERS] 
; 

//Player
new 
    PlayerText:ScoreTextDraw[MAX_PLAYERS], 
    PlayerText:MostrarLevel[MAX_PLAYERS] 
;



Re: AtualizarS - s4kuL - 10.10.2016

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Vai continuar dando warning, pois as variбveis TextDraw devem ser definidas assim:
Код:
//Global
new 
    Text:ScoreTextDraw[MAX_PLAYERS], 
    Text:MostrarLevel[MAX_PLAYERS] 
; 

//Player
new 
    PlayerText:ScoreTextDraw[MAX_PLAYERS], 
    PlayerText:MostrarLevel[MAX_PLAYERS] 
;
Imagino que ele pelo menos tenha lembrado de criar as variбveis.. kkkk


Re: AtualizarS - FalcaoNC - 10.10.2016

Quote:
Originally Posted by s4kuL
Посмотреть сообщение
Imagino que ele pelo menos tenha lembrado de criar as variбveis.. kkkk
Tinha criado sim, kk pelo menos disso nгo me esqueзo haha'