[Ajuda] Nao aparece
#6

Quote:
Originally Posted by Don_Speed
Посмотреть сообщение


Nao se coloca isso dentro da swicth.
Nada a ver, mano. Pode-se colocar sim.

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;
}
@EDIT:
Se nгo der certo, substitua switch por if e else if
Reply


Messages In This Thread
Nao aparece - by Don_Speed - 02.12.2012, 14:51
Re: Nao aparece - by @Riichard - 02.12.2012, 15:02
Re: Nao aparece - by Don_Speed - 02.12.2012, 15:12
Re: Nao aparece - by Lucas-Fc - 02.12.2012, 15:41
Re: Nao aparece - by Don_Speed - 02.12.2012, 16:24
Re: Nao aparece - by Rodney Francalim - 02.12.2012, 16:27

Forum Jump:


Users browsing this thread: 2 Guest(s)