02.12.2012, 14:51
Essa coisas nao aparecen (Gasolina & Lataria)
Fiz um de forma diferente do outro !
CODE:
As outras duas aparecem!
Fiz um de forma diferente do outro !
CODE:
pawn Код:
forward AtualizarVelocimetro(playerid);
public AtualizarVelocimetro(playerid)
{
static STR[30];
format(STR, 30, "%i", GetPlayerSpeed(playerid));
TextDrawSetString(PlayerInfo[playerid][Velocidade], STR);
TextDrawShowForPlayer(playerid, PlayerInfo[playerid][Velocidade]);
TextDrawSetString(PlayerInfo[playerid][KMH], "KMH");
TextDrawShowForPlayer(playerid, PlayerInfo[playerid][KMH]);
new vehicleid = GetPlayerVehicleID(playerid);
Gasolina[vehicleid] -= 0.1;
new Don[100];
switch(Gasolina[vehicleid])
{
case 901 .. MAX_FUEL:format(Don, sizeof(Don), "gasolina: ~g~IIIIIIIIII");
case 801 .. 900:format(Don, sizeof(Don), "gasolina: ~g~IIIIIIIII~r~.");
case 701 .. 800:format(Don, sizeof(Don), "gasolina: ~g~IIIIIIII~r~..");
case 601 .. 700:format(Don, sizeof(Don), "gasolina: ~g~IIIIIII~r~...");
case 501 .. 600:format(Don, sizeof(Don), "gasolina: ~g~IIIIII~r~....");
case 401 .. 500:format(Don, sizeof(Don), "gasolina: ~g~IIIII~r~.....");
case 301 .. 400:format(Don, sizeof(Don), "gasolina: ~g~IIII~r~......");
case 201 .. 300:format(Don, sizeof(Don), "gasolina: ~g~III~r~.......");
case 101 .. 200:format(Don, sizeof(Don), "gasolina: ~g~II~r~........");
case 50 .. 100:format(Don, sizeof(Don), "gasolina: ~g~I~r~.........");
case 0 .. 49 :
{
new mot, lu, alar, por, cap, porma, ob;
GetVehicleParamsEx(vehicleid, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(vehicleid, 0, lu, alar, por, cap, porma, ob);
format(Don, sizeof(Don), "gasolina: ~r~acabou");
}
}
TextDrawSetString(PlayerInfo[playerid][gasolina],Don);
TextDrawShowForPlayer(playerid, PlayerInfo[playerid][gasolina]);
new Float:LATARIA;
GetVehicleHealth(vehicleid, LATARIA);
switch(LATARIA)
{
case 901 .. 1000:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~IIIIIIIIII");
case 801 .. 900 :TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~IIIIIIIII~r~.");
case 701 .. 800:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~IIIIIIII~r~..");
case 601 .. 700:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~IIIIIII~r~...");
case 501 .. 600:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~IIIIII~r~....");
case 401 .. 500:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~IIIII~r~.....");
case 301 .. 400:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~IIII~r~......");
case 201 .. 300:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~III~r~.......");
case 101 .. 200:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~II~r~........");
case 51 .. 100:TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~g~I~r~.........");
case 0 .. 50:
{
new mot, lu, alar, por, cap, porma, ob;
GetVehicleParamsEx(vehicleid, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(vehicleid, 0, lu, alar, por, cap, porma, ob);
TextDrawSetString(PlayerInfo[playerid][Lataria], "lataria: ~r~fundiu");
}
}
TextDrawShowForPlayer(playerid, PlayerInfo[playerid][Lataria]);
return 1;
}