SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 12/07/2018, 11:42 PM   #1
Surak
Little Clucker
 
Join Date: Jun 2018
Posts: 16
Reputation: 0
Post SISTEMA DE LEVEL POR XP

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

Code:
new Text:ScoreTextdraw[MAX_PLAYERS];
Code:
TextDrawShowForPlayer(playerid, ScoreTextdraw[playerid]);
Code:
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);
Surak is offline   Reply With Quote
Old 12/07/2018, 11:45 PM   #2
Surak
Little Clucker
 
Join Date: Jun 2018
Posts: 16
Reputation: 0
Default Re: SISTEMA DE LEVEL POR XP

Code:
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;
}
Surak is offline   Reply With Quote
Old 12/07/2018, 11:53 PM   #3
BrGabrielBr
Huge Clucker
 
BrGabrielBr's Avatar
 
Join Date: Jul 2016
Location: Rio De Janeiro
Posts: 425
Reputation: 5
Default Re: SISTEMA DE LEVEL POR XP

Quote:
Originally Posted by Surak View Post
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

Code:
new Text:ScoreTextdraw[MAX_PLAYERS];
Code:
TextDrawShowForPlayer(playerid, ScoreTextdraw[playerid]);
Code:
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
__________________
BrGabrielBr is offline   Reply With Quote
Old 12/07/2018, 11:59 PM   #4
Surak
Little Clucker
 
Join Date: Jun 2018
Posts: 16
Reputation: 0
Default Re: SISTEMA DE LEVEL POR XP

Quote:
Originally Posted by BrGabrielBr View Post
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
Surak is offline   Reply With Quote
Old 13/07/2018, 12:31 AM   #5
Surak
Little Clucker
 
Join Date: Jun 2018
Posts: 16
Reputation: 0
Default Re: SISTEMA DE LEVEL POR XP

AINDA PODEM AJUDAREM OK?
Surak is offline   Reply With Quote
Old 13/07/2018, 12:46 AM   #6
FerrariL
Gangsta
 
FerrariL's Avatar
 
Join Date: Sep 2016
Location: Goiânia
Posts: 527
Reputation: 22
Default Re: SISTEMA DE LEVEL POR XP

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.
__________________
Faço sistemas por encomenda, discord: FerrariL
#5104
FerrariL is offline   Reply With Quote
Old 13/07/2018, 12:45 PM   #7
Surak
Little Clucker
 
Join Date: Jun 2018
Posts: 16
Reputation: 0
Default Re: SISTEMA DE LEVEL POR XP

Quote:
Originally Posted by FerrariL View Post
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.
Code:
============================================================================//
	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);
Code:
	new StringL[30];
 	format(StringL, sizeof(StringL),"Level: ~y~%d", GetPlayerScore(playerid));
    PlayerTextDrawSetString(playerid, jLevel[playerid], StringL);
Code:
new PlayerText:jLevel[MAX_PLAYERS];



ai o codigo :/ ainda não está atualizando !!
Surak is offline   Reply With Quote
Old 13/07/2018, 01:19 PM   #8
FerrariL
Gangsta
 
FerrariL's Avatar
 
Join Date: Sep 2016
Location: Goiânia
Posts: 527
Reputation: 22
Default Re: SISTEMA DE LEVEL POR XP

Poste toda função do UP
__________________
Faço sistemas por encomenda, discord: FerrariL
#5104
FerrariL is offline   Reply With Quote
Old 13/07/2018, 01:25 PM   #9
AdrianoStk
Huge Clucker
 
AdrianoStk's Avatar
 
Join Date: Jan 2013
Location: Presidente Prudente-SP
Posts: 340
Reputation: 19
Default Re: SISTEMA DE LEVEL POR XP

Fiz aqui funcionou perfeitamente!

PHP Code:
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); 
__________________
Hayllander Server's

Breve, nos servidores

_______________________
[FilterScript] >> Sistema de pintar veículos via TextDraw
AdrianoStk is offline   Reply With Quote
Old 13/07/2018, 02:48 PM   #10
Surak
Little Clucker
 
Join Date: Jun 2018
Posts: 16
Reputation: 0
Default Re: SISTEMA DE LEVEL POR XP

Quote:
Originally Posted by FerrariL View Post
Poste toda função do UP
Funcionou .. agora vou fazer uma progress bar em baixo.. oq uso? pra ela mexer a cada level?
Surak is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Pedido] Sistema Level por Exp Raridade Português/Portuguese 11 25/12/2017 04:09 AM
[Ajuda] Sistema de Level LucasDias Português/Portuguese 13 04/07/2015 02:04 PM
[Ajuda] Sistema de Level JheY Português/Portuguese 20 05/04/2015 12:55 AM
[FilterScript] Sistema de level Lós Lançamentos/Releases 21 11/12/2013 12:22 PM
Sistema de level UP JFT Português/Portuguese 9 28/03/2010 11:26 PM


All times are GMT. The time now is 08:33 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.