[Ajuda] Problemas TextDrawns.
#1

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.
Reply
#2

faltou o principal que sгo os cуdigos.
Reply
#3

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.
Reply
#4

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

Код:
Text:Velocimetro[playerid]

Text:Combustivel[playerid]
Reply
#5

Poste os cуdigos para podermos lhe ajudar!
Reply
#6

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)