SA-MP Forums Archive
[Ajuda] SISTEMA DE LEVEL POR XP - 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] SISTEMA DE LEVEL POR XP (/showthread.php?tid=656312)



SISTEMA DE LEVEL POR XP - Surak - 12.07.2018

Bom eu tenho um sistema de level por xp textdraw.. mas quando o level upa a textdraw fica parada.. o numero sу altera quando reloga :/ queria uma ajudinha se possivel dica sla

Код:
new Text:ScoreTextdraw[MAX_PLAYERS];
Код:
TextDrawShowForPlayer(playerid, ScoreTextdraw[playerid]);
Код:
new sistemaxp[128];

	// TEXT DRAW DE LEVEL - BAGUNЗADO
	format(sistemaxp, sizeof(sistemaxp), "Level: ~y~%d",GetPlayerScore(playerid));
	ScoreTextdraw[playerid] = TextDrawCreate(555.764709, 7.583313, sistemaxp);
	TextDrawColor(ScoreTextdraw[playerid], -1);
	TextDrawAlignment(ScoreTextdraw[playerid],1);
	TextDrawFont(ScoreTextdraw[playerid], 1);
	TextDrawLetterSize(ScoreTextdraw[playerid], 0.264588, 0.993333);
	TextDrawSetOutline(ScoreTextdraw[playerid],1);
	TextDrawSetProportional(ScoreTextdraw[playerid],1);
	TextDrawBackgroundColor(ScoreTextdraw[playerid],51);



Re: SISTEMA DE LEVEL POR XP - Surak - 12.07.2018

Код:
forward scoretimer(playerid);
public scoretimer()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new score[128];
            format(score, sizeof(score), "~w~Level: ~y~%d",GetPlayerScore(i));
            TextDrawSetString(ScoreTextdraw[i], score);
        }
    }
    return 1;
}



Re: SISTEMA DE LEVEL POR XP - BrGabrielBr - 12.07.2018

Quote:
Originally Posted by Surak
Посмотреть сообщение
Bom eu tenho um sistema de level por xp textdraw.. mas quando o level upa a textdraw fica parada.. o numero sу altera quando reloga :/ queria uma ajudinha se possivel dica sla

Код:
new Text:ScoreTextdraw[MAX_PLAYERS];
Код:
TextDrawShowForPlayer(playerid, ScoreTextdraw[playerid]);
Код:
new sistemaxp[128];

	// TEXT DRAW DE LEVEL - BAGUNЗADO
	format(sistemaxp, sizeof(sistemaxp), "Level: ~y~%d",GetPlayerScore(playerid));
	ScoreTextdraw[playerid] = TextDrawCreate(555.764709, 7.583313, sistemaxp);
	TextDrawColor(ScoreTextdraw[playerid], -1);
	TextDrawAlignment(ScoreTextdraw[playerid],1);
	TextDrawFont(ScoreTextdraw[playerid], 1);
	TextDrawLetterSize(ScoreTextdraw[playerid], 0.264588, 0.993333);
	TextDrawSetOutline(ScoreTextdraw[playerid],1);
	TextDrawSetProportional(ScoreTextdraw[playerid],1);
	TextDrawBackgroundColor(ScoreTextdraw[playerid],51);
me passa seu f a c e b o k que te passo meu lб no privado


Re: SISTEMA DE LEVEL POR XP - Surak - 12.07.2018

Quote:
Originally Posted by BrGabrielBr
Посмотреть сообщение
me passa seu f a c e b o k que te passo meu lб no privado
Cauг Kaiky Queiroz
vai pv q passo link


Re: SISTEMA DE LEVEL POR XP - Surak - 13.07.2018

AINDA PODEM AJUDAREM OK?


Re: SISTEMA DE LEVEL POR XP - FerrariL - 13.07.2018

Nгo precisa de criar um timer, pior ainda com looping. Procure a funзгo que seta o level e use a funзгo PlayerTextDrawSetString. Outro erro no seu codigo, vocк esta usando uma textdraw pra todo o server, isso vai causar erro, use PlayerTextdraw.


Re: SISTEMA DE LEVEL POR XP - Surak - 13.07.2018

Quote:
Originally Posted by FerrariL
Посмотреть сообщение
Nгo precisa de criar um timer, pior ainda com looping. Procure a funзгo que seta o level e use a funзгo PlayerTextDrawSetString. Outro erro no seu codigo, vocк esta usando uma textdraw pra todo o server, isso vai causar erro, use PlayerTextdraw.
Код:
============================================================================//
	jLevel[playerid] = CreatePlayerTextDraw(playerid, 579.000000, 22.166673, "Level: ~y~%d");
	PlayerTextDrawLetterSize(playerid, jLevel[playerid], 0.303499, 1.325833);
	PlayerTextDrawAlignment(playerid, jLevel[playerid], 2);
	PlayerTextDrawColor(playerid, jLevel[playerid], -1);
	PlayerTextDrawSetShadow(playerid, jLevel[playerid], 0);
	PlayerTextDrawSetOutline(playerid, jLevel[playerid], 1);
	PlayerTextDrawBackgroundColor(playerid, jLevel[playerid], 51);
	PlayerTextDrawFont(playerid, jLevel[playerid], 2);
	PlayerTextDrawSetProportional(playerid, jLevel[playerid], 1);
Код:
	new StringL[30];
 	format(StringL, sizeof(StringL),"Level: ~y~%d", GetPlayerScore(playerid));
    PlayerTextDrawSetString(playerid, jLevel[playerid], StringL);
Код:
new PlayerText:jLevel[MAX_PLAYERS];


ai o codigo :/ ainda nгo estб atualizando !!


Re: SISTEMA DE LEVEL POR XP - FerrariL - 13.07.2018

Poste toda funзгo do UP


Re: SISTEMA DE LEVEL POR XP - AdrianoStk - 13.07.2018

Fiz aqui funcionou perfeitamente!

PHP код:
new PlayerText:ScoreTextdraw[MAX_PLAYERS];
public 
OnPlayerConnect(playerid)
{
    
ScoreTextdraw[playerid] = CreatePlayerTextDraw(playerid579.00000022.166673"Level: ~y~0");
    
PlayerTextDrawLetterSize(playeridScoreTextdraw[playerid], 0.3034991.325833);
    
PlayerTextDrawAlignment(playeridScoreTextdraw[playerid], 2);
    
PlayerTextDrawColor(playeridScoreTextdraw[playerid], -1);
    
PlayerTextDrawSetShadow(playeridScoreTextdraw[playerid], 0);
    
PlayerTextDrawSetOutline(playeridScoreTextdraw[playerid], 1);
    
PlayerTextDrawBackgroundColor(playeridScoreTextdraw[playerid], 51);
    
PlayerTextDrawFont(playeridScoreTextdraw[playerid], 2);
    
PlayerTextDrawSetProportional(playeridScoreTextdraw[playerid], 1);
    
PlayerTextDrawSetSelectable(playeridScoreTextdraw[playerid], 0);
    
PlayerTextDrawShow(playeridScoreTextdraw[playerid]);
    return 
1;
}
public 
OnPlayerDisconnect(playeridreason)
{
    
PlayerTextDrawHide(playeridScoreTextdraw[playerid]);
    
PlayerTextDrawDestroy(playeridScoreTextdraw[playerid]);
    return 
1;
}
//O codigo abaixo deve ser copiado e colado no seu gm/fs onde fica o sistema de
//Upar o nivel, ou seja, onde haja alteraзгo do nivel o player!
//OBS cole o abaixo ou apуs o nivel do player ser alterado!
new txdstr[16];
format(txdstr16"Level: ~y~%d"GetPlayerScore(playerid));
PlayerTextDrawSetString(playeridScoreTextdraw[playerid], txdstr); 



Re: SISTEMA DE LEVEL POR XP - Surak - 13.07.2018

Quote:
Originally Posted by FerrariL
Посмотреть сообщение
Poste toda funзгo do UP
Funcionou .. agora vou fazer uma progress bar em baixo.. oq uso? pra ela mexer a cada level?