Posts: 51
Threads: 11
Joined: Sep 2015
Reputation:
0
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.
faltou o principal que sгo os cуdigos.
Posts: 109
Threads: 11
Joined: Mar 2017
Reputation:
0
Poste os cуdigos para podermos lhe ajudar!
Posts: 51
Threads: 11
Joined: Sep 2015
Reputation:
0
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.