[AJUDA]Textdraw com string nгo aparece
#1

Bom galera, o meu problema й o seguinte:
Eu criei um textdraw simples no qual, quando o player muda o estado para PLAYER_STATE_DRIVER, aparece o textdraw com a informaзгo da quantidade de litros de combustivel que o player tem. O problema й que o textdraw nunca aparece, ja fui no Search, jб tentei um monte de coisas, mas nada funcionou. Meu cуdigo й esse:

Код:
new Text:Gasolina[MAX_PLAYERS];//topo do script

forward Speed();//para pegar a quantidade de litros

public OnGameModeInit()
{
   	for(new i = 0; i < MAX_PLAYERS; i++)//para mostrar para todos
	{ 	
		Gasolina[i] = TextDrawCreate(481.000000, 459.000000," ");
 		TextDrawAlignment(Gasolina[i], 0);
		TextDrawBackgroundColor(Gasolina[i], 0x000000ff);
		TextDrawFont(Gasolina[i], 1);
		TextDrawLetterSize(Gasolina[i], 0.599999, 1.900000);
		TextDrawColor(Gasolina[i], 0xffffffff);
		TextDrawSetOutline(Gasolina[i], 1);
		TextDrawSetProportional(Gasolina[i], 1);
	 	TextDrawSetShadow(Gasolina[i], 1);
    }
    SetTimer("Speed", 1000, 1);//seta o timer para pegar a quantidade de litros

public OnPlayerStateChange(playerid, newstate, oldstate)//para sу aparecer quando estiver dirigindo
{
if(newstate == PLAYER_STATE_DRIVER)
	{
		TextDrawShowForPlayer(playerid, Gasolina[playerid]);
	}
return 1;
}

public Speed()//para setar a quantidade de litros no textdraw sempre que o timer mandar executб-lo
{
	for(new i=0;i<MAX_PLAYERS;i++)
	{
		if(IsPlayerConnected(i))
		{
			new string[128];
			format(string,256,"~b~Combustivel: ~w~%d Litros", Petrol[i]);
      if(IsPlayerInAnyVehicle(i))
			{
				TextDrawSetString(Gasolina[i], string);
			}
		}
	}
}
Reply


Messages In This Thread
[AJUDA]Textdraw com string nгo aparece - by [BEP]AcerPilot - 03.06.2010, 19:14
Re: [AJUDA]Textdraw com string nгo aparece - by andmeida10 - 03.06.2010, 19:33
Re: [AJUDA]Textdraw com string nгo aparece - by ipsBruno - 03.06.2010, 21:46
Re: [AJUDA]Textdraw com string nгo aparece - by [BEP]AcerPilot - 03.06.2010, 21:52
Re: [AJUDA]Textdraw com string nгo aparece - by SuB_ZeRo0_ - 03.06.2010, 21:59
Re: [AJUDA]Textdraw com string nгo aparece - by [BEP]AcerPilot - 03.06.2010, 23:15
Re: [AJUDA]Textdraw com string nгo aparece - by Brunin_OwnZ - 04.06.2010, 14:54
Re: [AJUDA]Textdraw com string nгo aparece - by [BEP]AcerPilot - 04.06.2010, 21:04
Re: [AJUDA]Textdraw com string nгo aparece - by Brunin_OwnZ - 04.06.2010, 21:24
Re: [AJUDA]Textdraw com string nгo aparece - by [BEP]AcerPilot - 05.06.2010, 02:25

Forum Jump:


Users browsing this thread: 1 Guest(s)