SA-MP Forums

Go Back   SA-MP Forums > Non-English > Languages > Português/Portuguese

Reply
 
Thread Tools Display Modes
Old 02/12/2012, 02:51 PM   #1
Don_Speed
High-roller
 
Don_Speed's Avatar
 
Join Date: Sep 2011
Location: Curitiba / PR
Posts: 3,272
Reputation: 266
Default Nao aparece

Essa coisas nao aparecen (Gasolina & Lataria)
Fiz um de forma diferente do outro !
CODE:
pawn Code:
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;
}
As outras duas aparecem!
__________________
Youtubar
Discord : Don_Speed#6282
Don_Speed is offline   Reply With Quote
Old 02/12/2012, 03:02 PM   #2
@Riichard
High-roller
 
@Riichard's Avatar
 
Join Date: Feb 2012
Location: Brazil
Posts: 2,325
Reputation: 227
Default Re: Nao aparece

Não sei dizer muito sobre o uso do switch, mas coloque as TextDrawShowForPlayer, logo a baixo das format da mesma.
__________________
Style Drift Show 2017
- Em breve!
@Riichard is offline   Reply With Quote
Old 02/12/2012, 03:12 PM   #3
Don_Speed
High-roller
 
Don_Speed's Avatar
 
Join Date: Sep 2011
Location: Curitiba / PR
Posts: 3,272
Reputation: 266
Default Re: Nao aparece

Quote:
Originally Posted by @Riichard View Post
Não sei dizer muito sobre o uso do switch, mas coloque as TextDrawShowForPlayer, logo a baixo das format da mesma.
Nao se coloca isso dentro da swicth.
__________________
Youtubar
Discord : Don_Speed#6282
Don_Speed is offline   Reply With Quote
Old 02/12/2012, 03:41 PM   #4
Lucas-Fc
High-roller
 
Join Date: Sep 2012
Location: minha casa
Posts: 1,146
Reputation: 24
Default Re: Nao aparece

UP Alguém ajuda o cara !
Lucas-Fc is offline   Reply With Quote
Old 02/12/2012, 04:24 PM   #5
Don_Speed
High-roller
 
Don_Speed's Avatar
 
Join Date: Sep 2011
Location: Curitiba / PR
Posts: 3,272
Reputation: 266
Default Re: Nao aparece

Up!
Isso so acontece quando eu uso a TextDrawSetString sem o format.
__________________
Youtubar
Discord : Don_Speed#6282
Don_Speed is offline   Reply With Quote
Old 02/12/2012, 04:27 PM   #6
Rodney Francalim
Gangsta
 
Rodney Francalim's Avatar
 
Join Date: Jun 2010
Location: Fortaleza, CE.
Posts: 667
Reputation: 92
Default Re: Nao aparece

Quote:
Originally Posted by Don_Speed View Post


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

pawn Code:
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
__________________


"O que é mais instigante nestes tempos instigantes é que ainda não estamos pensando." – Martin Heidegger
Rodney Francalim is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Ajuda] Nao aparece mau.tito Português/Portuguese 3 19/09/2012 01:10 AM
[Ajuda] não aparece s4kuL Português/Portuguese 0 09/09/2012 01:50 PM
[Pedido] Nao aparece!!!! Aleex_Mason Português/Portuguese 10 08/09/2012 02:09 PM
[AJUDA]/su não aparece e.e RenjiAbarai Português/Portuguese 3 16/02/2012 07:53 PM


All times are GMT. The time now is 11:50 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.