[HELP] fuel gauge
#1

Right i keep getting a few errors when i try to compile my script.
I think it has something to do with the fuel gauge, the textdraws or even the speedo for it.
Iv had a look at https://sampforum.blast.hk/showthread.php?tid=45235 and carnt seem to find away around it.

The error i get while compiling is this.
C:\Users\Adam\Desktop\SAMP Files\Project\EvG.pwn(976) : error 021: symbol already defined: "strmid"
C:\Users\Adam\Desktop\SAMP Files\Project\EvG.pwn(978) : error 020: invalid symbol name ""
C:\Users\Adam\Desktop\SAMP Files\Project\EvG.pwn(1012) : error 001: expected token: "-identifier-", but found "["
C:\Users\Adam\Desktop\SAMP Files\Project\EvG.pwn(1020) : error 029: invalid expression, assumed zero
C:\Users\Adam\Desktop\SAMP Files\Project\EvG.pwn(1020) : error 035: argument type mismatch (argument 1)
C:\Users\Adam\Desktop\SAMP Files\Project\EvG.pwn(1020) : error 020: invalid symbol name ""
C:\Users\Adam\Desktop\SAMP Files\Project\EvG.pwn(1020) : fatal error 107: too many error messages on one line

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

So, im posting lines 976 to 1042

pawn Код:
strmid( TankString, string, 0, 256 )
    {
    new tmp[255];
    TankString[playerid]=string;
    TextDrawDestroy(medidorTanque[playerid]);
    format(tmp, sizeof(tmp), "%s %s",TankString[playerid],SpeedString[playerid]);
    medidorTanque[playerid] = TextDrawCreate(470.000000, 133.000000,tmp);
    TextDrawFont(medidorTanque[playerid],3);
    TextDrawTextSize(medidorTanque[playerid], 50.0, 35.0);
    TextDrawSetOutline(medidorTanque[playerid],1);
    TextDrawShowForPlayer(playerid,medidorTanque[playerid]);
    }
//-----------------------------------------------------------------------------------------------------
public Speedometer()
    {
    new type;
    for (new player=0;player<MAX_PLAYERS_FUEL;player++)
        {
        if ((IsPlayerConnected(player))&&(IsPlayerInAnyVehicle(player)))
            {
            new wid = GetPlayerVehicleID(player);
            type=GetVehicleTypeFromId(GetVehicleModel(wid));
            if  ((type==1)|(type==2)|(type==3))
                {
                fuelgauge(player);
                }
            else
                {
                fuelgauge2(player);
                }
            }
        }
    }
//-----------------------------------------------------------------------------------------------------
  fuelgauge(playerid)
    {
    new tmp[255];
    new Float:x,Float:y,Float:z;
    new Float:distance;
    GetPlayerPos(playerid, x, y, z);
    distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[playerid][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[playerid][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[playerid][LastZ])),2));
    SavePlayerPos[playerid][LastX] = x;
    SavePlayerPos[playerid][LastY] = y;
    SavePlayerPos[playerid][LastZ] = z;
    format(tmp, sizeof(tmp), "KpH:%d",floatround(distance * 7.2));
    SpeedString[playerid]=tmp;
    Kilometers[playerid]=Kilometers[playerid]+floatround(distance * 7.2);
    if  (Kilometers[playerid]>3000.0)
        {
        Kilometers[playerid]=0.0;
        if  (GetPlayerState(playerid)==PLAYER_STATE_DRIVER)
                    {
                    combustible[GetPlayerVehicleID(playerid)]--;
                    format(tmp, sizeof(tmp), "Fuel:%d", combustible[GetPlayerVehicleID(playerid)]);
                    actualizarMedidor(playerid,tmp);
                    }
        }
    format(tmp, sizeof(tmp), "%s %s",TankString[playerid],SpeedString[playerid]);
    TextDrawDestroy(medidorTanque[playerid]);
    medidorTanque[playerid] = TextDrawCreate(500.0, 100.0,tmp);
    TextDrawFont(medidorTanque[playerid],3);
    TextDrawColor(medidorTanque[playerid],COLOR_GREEN);
    TextDrawLetterSize(medidorTanque[playerid], 1, 1.33);
    TextDrawTextSize(medidorTanque[playerid], 50.0, 35.0);
    TextDrawSetOutline(medidorTanque[playerid],1);
    TextDrawShowForPlayer(playerid,medidorTanque[playerid]);
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)