[Ajuda] Velocimetro nгo carrega - 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] Velocimetro nгo carrega (
/showthread.php?tid=462233)
Velocimetro nгo carrega -
minimessi10 - 05.09.2013
Entгo criei um velocimetro mas ele nгo estб carregando por que ?
OnGameModeInit()
pawn Код:
SetTimer("Speedometer", 1000, 1);
Speedometer e CarregarTextDraws();
pawn Код:
CarregarTextDraws()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
Posto[i] = TextDrawCreate(44.000000, 317.000000, " ");
TextDrawBackgroundColor(Posto[i], 255);
TextDrawFont(Posto[i], 3);
TextDrawLetterSize(Posto[i], 0.519999, 1.800000);
TextDrawColor(Posto[i], -1);
TextDrawSetOutline(Posto[i], 0);
TextDrawSetProportional(Posto[i], 1);
TextDrawSetShadow(Posto[i], 1);
TextDrawSetSelectable(Posto[i], 0);
}
return 1;
}
forward Speedometer();
public Speedometer()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerInAnyVehicle(i))
{
new vehicleid = GetPlayerVehicleID(i);
if(GetVehicleModel(vehicleid) == 481 || GetVehicleModel(vehicleid) == 509 || GetVehicleModel(vehicleid) == 510)
{
new string[64];
format(string, sizeof(string), "~b~~h~~h~%d ~y~~h~Litros", Gasolina[i]);
TextDrawSetString(Posto[i], string);
}
else
{
new string[64];
format(string, sizeof(string), "~b~~h~~h~%d ~y~~h~Litros", Gasolina[i]);
TextDrawSetString(Posto[i], string);
}
}
}
}
}
Respuesta: Velocimetro nгo carrega -
ViniKuliveguisky - 06.09.2013
pawn Код:
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
Posto[i] = TextDrawCreate(44.000000, 317.000000, " ");
TextDrawBackgroundColor(Posto[i], 255);
TextDrawFont(Posto[i], 3);
TextDrawLetterSize(Posto[i], 0.519999, 1.800000);
TextDrawColor(Posto[i], -1);
TextDrawSetOutline(Posto[i], 0);
TextDrawSetProportional(Posto[i], 1);
TextDrawSetShadow(Posto[i], 1);
TextDrawSetSelectable(Posto[i], 0);
}
}
Tenta assim, nгo sei se vai funcionar.
@Obs: o certo nгo era estar no OnPlayerConnect?
Re: Velocimetro nгo carrega -
Juniiro3 - 06.09.2013
//OnPlayerConnect
TextDrawShowForPlayer ( IdDaTextDraw ) ;