05.09.2013, 23:13
Entгo criei um velocimetro mas ele nгo estб carregando por que ?
OnGameModeInit()
Speedometer e CarregarTextDraws();
OnGameModeInit()
pawn Код:
CarregarTextDraws();
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);
}
}
}
}
}