[Resolvido]
#1

Tou a fazer um speedomer, na de mais, peguei num e editei:
pawn Код:
public speedometer()
{
    new Float:Speed;
    new vehicleid;
    new playerid;
  new string[20];
    for(playerid = 0; playerid < MAX_PLAYERS; playerid++)
    {
        if(SpeedProgress[playerid] != INVALID_BAR_ID)
        {
          vehicleid = GetPlayerVehicleID(playerid);
            GetVehicleSpeed(vehicleid, Speed);
      format(string, sizeof(string), "Velocidade: %i km/h", floatround(Speed));
            SetProgressBarValue(SpeedProgress[playerid], Speed);
      TextDrawSetString(SpeedProgressMsg[playerid], string);
      TextDrawShowForPlayer(playerid, SpeedProgressMsg[playerid]);
            UpdateProgressBar(SpeedProgress[playerid], playerid);
        }
    }
    return 1;
}
mas dб-me estes erros
Код:
C:\Program Files\Rockstar Games\GTA San Andreas\server\BC_RP.pwn(14128) : error 017: undefined symbol "SpeedProgress"
C:\Program Files\Rockstar Games\GTA San Andreas\server\BC_RP.pwn(14128) : warning 215: expression has no effect
C:\Program Files\Rockstar Games\GTA San Andreas\server\BC_RP.pwn(14128) : error 001: expected token: ";", but found "]"
C:\Program Files\Rockstar Games\GTA San Andreas\server\BC_RP.pwn(14128) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GTA San Andreas\server\BC_RP.pwn(14128) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

usa search na comunidade do Dark Team PT, ele postou lб um COD
Reply
#3

Que comunidade?
Reply
#4

ve a assinatura dele... tem la o link da comunidade
Reply
#5

Nгo te assinatura
Reply
#6

http://pt-br-samp.vacau.com/
Reply
#7

ja tive a ver mas nгo corresponde ao que quero
Reply
#8

Toma...:

Topo do GM:

pawn Код:
forward Speedometer();

em OnGameModeInit:


pawn Код:
SetTimer("Speedometer", 1000, true);

pawn Код:
public Speedometer()
{
  for(new i = 0; i < MAX_PLAYERS; i++)
    {
      new State = GetPlayerState(i);
        if(State == PLAYER_STATE_DRIVER && IsPlayerInAnyVehicle(i))
      {
        #define MULTIPLY_SPEED 4
        new carid = GetPlayerVehicleID(i);
            new VehicleModel = GetVehicleModel(GetPlayerVehicleID(i));

            new Float:x, Float:y, Float:z, Float:health, string[256]; TextDrawDestroy(black); TextDrawDestroy(Speedom[i]);
            GetPlayerPos(i, x, y, z); GetVehicleHealth(GetPlayerVehicleID(i), health);
            new Float:Dis = floatsqroot(floatpower(floatabs(floatsub(OldCoordsX[i],x)),2) + floatpower(floatabs(floatsub(OldCoordsY[i],y)),2));

            if(VehicleModel==509||VehicleModel==481||VehicleModel==510) { SetVehicleHealth(GetPlayerVehicleID(i), 1000); Gas[carid] = 100; }
            if(VehicleModel==520||VehicleModel==476||VehicleModel==593||VehicleModel==553||VehicleModel==513||VehicleModel==512||VehicleModel==577||VehicleModel==592||VehicleModel==511||VehicleModel==539||VehicleModel==464||VehicleModel==519) { Gas[carid] = 100; }
            new speed = (floatround(Dis)*MULTIPLY_SPEED);

      new Sspeed[15];

        if( speed == 0) {
                format(Sspeed,sizeof(Sspeed),"~w~%dKm/H",(floatround(Dis)*MULTIPLY_SPEED));
          } else if( speed >= 1 && speed <= 60 ){
            format(Sspeed,sizeof(Sspeed),"~W~%dKm/H",(floatround(Dis)*MULTIPLY_SPEED));

          } else if( speed >= 61 && speed <= 120 ){
            format(Sspeed,sizeof(Sspeed),"~R~%dKm/H",(floatround(Dis)*MULTIPLY_SPEED));

          } else {
                format(Sspeed,sizeof(Sspeed),"~R~%dKm/H",(floatround(Dis)*MULTIPLY_SPEED));

          }
      new Ggas[30];
            if(VehicleModel==509||VehicleModel==481||VehicleModel==510)

            {format(Ggas,sizeof(Ggas),"~G~N/A");}
        if( Gas[carid] == 0) {
                format(Ggas,sizeof(Ggas),"~R~Vazio");
          } else if( Gas[carid]<= 20){
            format(Ggas,sizeof(Ggas),"~R~%d",(Gas[carid]));

          } else if( Gas[carid] >= 21 && Gas[carid]<=100){
            format(Ggas,sizeof(Ggas),"~w~%d",(Gas[carid]));

          }

      /*new Ggas[30];
            if(VehicleModel==509||VehicleModel==481||VehicleModel==510)

            {format(Ggas,sizeof(Ggas),"~G~N/A");}
        if( Gas[carid] == 0) {
                format(Ggas,sizeof(Ggas),"~R~Vazio");
          } else if( Gas[carid]<= 20){
            format(Sspeed,sizeof(Sspeed),"~R~%.3f",(Gas[carid]));

          } else if( Gas[carid] > 20){
            format(Sspeed,sizeof(Sspeed),"~G~%.3f",(Gas[carid]));

          } */


            format(string,sizeof(string),"~g~R$:~w~%d~n~~r~Fome:%d~n~~B~Veiculo:~n~~w~%s~n~~B~Velocidade:~n~~W~%s~n~~B~Life: ~w~%.1f~n~~B~Gas:~w~ %s" ,GP[i],PlayerInfo[i][pFomee],vehName[GetVehicleModel(GetPlayerVehicleID(i))-400], Sspeed, health/10,Ggas);

            black = TextDrawCreate(494.000000,375.000000,"_");
            TextDrawTextSize(black,600.000000,0.000000);
            TextDrawAlignment(black,0);
            TextDrawFont(black,2);
            TextDrawLetterSize(black,1.700000,6.250000);
            TextDrawSetOutline(black,1);
            TextDrawSetProportional(black,1);
            TextDrawSetShadow(black,1);

            Speedom[i] = TextDrawCreate(495.000000,376.000000,string);
        TextDrawTextSize(Speedom[i],600.000000,0.000000);
            TextDrawAlignment(Speedom[i],0);
            TextDrawFont(Speedom[i],2);
            TextDrawLetterSize(Speedom[i],0.299999,1.000000);
            TextDrawSetOutline(Speedom[i],1);
            TextDrawSetProportional(Speedom[i],1);
            TextDrawSetShadow(Speedom[i],1);

            TextDrawShowForPlayer(i, black);
            TextDrawShowForPlayer(i, Speedom[i]);
            OldCoordsX[i] = x; OldCoordsY[i] = y;
        } else { TextDrawHideForPlayer(i, black); TextDrawHideForPlayer(i, Speedom[i]); }
    }
        return true;
}
Reply
#9

Ah baixa Esse Velocнmetro Analуgico, criado por "Kolowy licznik predkosci zaladowany", havia em meu pc desde quando eu era noob ainda sou rs..
Reply
#10

Qual??manda por pm se quizeres
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)