Speedo Help again :/
#8

Heres the new code. After awhile it said I was going 4 MPH. Idk what is wrong. I also get an error if i uncomment the TextDrawHide line.
Код:
C:\Users\zack\Desktop\SAMP03CSVR_WIN32 (1)\gamemodes\MYSQLgm.pwn(552) : error 028: invalid subscript (not an array or too many subscripts): "Speedo"
C:\Users\zack\Desktop\SAMP03CSVR_WIN32 (1)\gamemodes\MYSQLgm.pwn(552) : warning 215: expression has no effect
C:\Users\zack\Desktop\SAMP03CSVR_WIN32 (1)\gamemodes\MYSQLgm.pwn(552) : error 001: expected token: ";", but found "]"
C:\Users\zack\Desktop\SAMP03CSVR_WIN32 (1)\gamemodes\MYSQLgm.pwn(552) : error 029: invalid expression, assumed zero
C:\Users\zack\Desktop\SAMP03CSVR_WIN32 (1)\gamemodes\MYSQLgm.pwn(552) : fatal error 107: too many error messages on one line
pawn Код:
forward Speedometer(playerid);
public Speedometer(playerid)
{
    new Float:VehVelocity[3];
    new State = GetPlayerState(playerid);
    if(State == PLAYER_STATE_DRIVER && IsPlayerInAnyVehicle(playerid))
    {
        #define MULTIPLY_SPEED  4
        new vID = GetPlayerVehicleID(playerid);
        GetVehicleVelocity(vID, VehVelocity[0], VehVelocity[1], VehVelocity[2]);
        new Float:speed = floatsqroot(VehVelocity[0] * VehVelocity[0] + VehVelocity[1] * VehVelocity[1] + VehVelocity[2] * VehVelocity[2]);
        new Sspeed[15], string[200];
       
        if( speed == 0) {
            format(Sspeed,sizeof(Sspeed),"~G~%dm/h",(floatround(speed)*MULTIPLY_SPEED));
        } else if( speed >= 1 && speed <= 65 ){
            format(Sspeed,sizeof(Sspeed),"~G~%dm/h",(floatround(speed)*MULTIPLY_SPEED));
        } else if( speed >= 66 && speed <= 120 ){
            format(Sspeed,sizeof(Sspeed),"~Y~%dm/h",(floatround(speed)*MULTIPLY_SPEED));
        } else {
            format(Sspeed,sizeof(Sspeed),"~R~%dm/h",(floatround(speed)*MULTIPLY_SPEED));
        }

        format(string,sizeof(string),"Speed: %s", Sspeed);
        TextDrawSetString(Speedo, string);
        TextDrawShowForPlayer(playerid, Speedo);
    }
    else
    {
        //TextDrawHideForPlayer(playerid, Speedo[playerid]);
    }
    return true;
}
Reply


Messages In This Thread
Speedo Help again :/ - by futuretrucker - 12.06.2011, 16:08
Re: Speedo Help again :/ - by Benjo - 12.06.2011, 16:42
Re: Speedo Help again :/ - by Iphone1234g - 12.06.2011, 16:45
Re: Speedo Help again :/ - by futuretrucker - 12.06.2011, 18:40
Re: Speedo Help again :/ - by alpha500delta - 12.06.2011, 19:16
Re: Speedo Help again :/ - by futuretrucker - 12.06.2011, 19:25
Re: Speedo Help again :/ - by alpha500delta - 12.06.2011, 19:53
Re: Speedo Help again :/ - by futuretrucker - 12.06.2011, 22:51
Re: Speedo Help again :/ - by Scenario - 12.06.2011, 23:18
Re: Speedo Help again :/ - by Benjo - 12.06.2011, 23:40

Forum Jump:


Users browsing this thread: 1 Guest(s)