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



Problemas TextDrawns. - MKVplayer123 - 15.03.2017

Olб, estou com uns probleminhas com textdrawns, aliбs, nunca fui bom nisso. kkk


Mas enfim...

O problema й o seguinte...

Eu criei todo o sistema de velocнmetro e gasolina, sу que simplismente, a textdrawn nгo marca isso.

Exp: Velocimetro: 0/xxx
Gasolina: 0/100

O que eu estou querendo dizer, й que mermo o veнculo tendo gasolina e se movendo, os "0" nгo se movem, marcando assim a velocidade e o combustнvel do veнculo.


Re: Problemas TextDrawns. - Whoo - 15.03.2017

faltou o principal que sгo os cуdigos.


Re: Problemas TextDrawns. - Luiiiz - 15.03.2017

Use 1 SetTimerEx.
Tipo:
PHP код:
OnPlayerStateChange:
if(
newstate == PLAYER_STATE_DRIVER)
{
SetTimerEx("Velo"5001"i"playerid); // isso й o timer de 500 milisegundos que se repete quando acaba. Isso vai fazer atualizar o combustivel e a velocidade.
return 1;
}
forward Velo(playerid);
public 
Velo(playerid)
{
new 
State;
State GetPlayerState(playerid); // aqui definimos o que й State.
if(State == PLAYER_STATE_DRIVER)
{
format(stringsizeof(string), "%i km/h"GetPlayerSpeed(playeridtrue)); // formatamos a mensagem da text de velocidade.
TextDrawSetString(Text:Velocimetro[playerid], string); // setamos a mensagem na text Velocimetro
TextDrawShowForPlayer(playeridText:Velocimetro[playerid]); // mostramos a text Velocimetro para o player.
format(stringsizeof(string), "%d/100 combustivel"Combustivel[playerid]); // formatamos a mensagem da text de combustivel.
TextDrawSetString(Text:Combustivel[playerid], string); // setamos a mensagem na text Combus.
TextDrawShowForPlayer(playeridText:Combus[playerid]); // mostramos a text Combus para o player.
}
return 
1;

Ai vocк adapta de acordo com seu gamemode. Foi feito agora, nгo sei se tem erro. Caso tenha, me fale.


Re: Problemas TextDrawns. - [BOPE]Seu._.Madruga - 15.03.2017

Tenho certeza que os erros estгo nisso, Mostre-nos como esta criando as Textdraws!

Код:
Text:Velocimetro[playerid]

Text:Combustivel[playerid]



Re: Problemas TextDrawns. - PowerEvolve - 15.03.2017

Poste os cуdigos para podermos lhe ajudar!


Re: Problemas TextDrawns. - MKVplayer123 - 15.03.2017

Default Re: Problemas TextDrawns.
Use 1 SetTimerEx.
Tipo:
PHP Code:
OnPlayerStateChange:

if(newstate == PLAYER_STATE_DRIVER)
{
SetTimerEx("Velo", 500, 1, "i", playerid); // isso й o timer de 500 milisegundos que se repete quando acaba. Isso vai fazer atualizar o combustivel e a velocidade.
return 1;
}

forward Velo(playerid);
public Velo(playerid)
{
new State;
State = GetPlayerState(playerid); // aqui definimos o que й State.
if(State == PLAYER_STATE_DRIVER)
{
format(string, sizeof(string), "%i km/h", GetPlayerSpeed(playerid, true)); // formatamos a mensagem da text de velocidade.
TextDrawSetString(Text:Velocimetro[playerid], string); // setamos a mensagem na text Velocimetro
TextDrawShowForPlayer(playerid, Text:Velocimetro[playerid]); // mostramos a text Velocimetro para o player.
format(string, sizeof(string), "%d/100 combustivel", Combustivel[playerid]); // formatamos a mensagem da text de combustivel.
TextDrawSetString(Text:Combustivel[playerid], string); // setamos a mensagem na text Combus.
TextDrawShowForPlayer(playerid, Text:Combus[playerid]); // mostramos a text Combus para o player.
}
return 1;
}
Ai vocк adapta de acordo com seu gamemode. Foi feito agora, nгo sei se tem erro. Caso tenha, me fale.


Vlw, funcionou, e obrigado a todos que tentaram ajudar.