Problem with Speedometer
#12

Alright. Just a sec, I will show you my code.

On top of the GM/FS

PHP Code:
new Text:SPEEDOS[MAX_PLAYERS];  //speedometer 
OnPlayerConnect put this
PHP Code:
SPEEDOS[playerid] = TextDrawCreate(10.0,200.0," ");
TextDrawShowForPlayer(playerid,SPEEDOS[playerid]); 
OnPlayerUpdate add this
PHP Code:
new vehicleid,Float:speed_x,Float:speed_y,Float:speed_z,Float:final_speed,speed_string[256],final_speed_int;
    
vehicleid GetPlayerVehicleID(playerid);
    if(
vehicleid != 0)
    {
        
GetVehicleVelocity(vehicleid,speed_x,speed_y,speed_z);
        
final_speed floatsqroot(((speed_x*speed_x)+(speed_y*speed_y))+(speed_z*speed_z))*136.666667;
        
final_speed_int floatround(final_speed,floatround_round);
        
format(speed_string,256,"Speed: %i",final_speed_int);
        
TextDrawSetString(SPEEDOS[playerid], speed_string);
    }
    else
    {
        
TextDrawSetString(SPEEDOS[playerid], " ");
    } 
Reply


Messages In This Thread
Problem with Speedometer - by GrInDzO - 08.01.2012, 20:53
Re: Problem with Speedometer - by Snowman12 - 08.01.2012, 22:18
Re: Problem with Speedometer - by GrInDzO - 10.01.2012, 16:15
Re: Problem with Speedometer - by GrInDzO - 02.02.2012, 19:40
Re: Problem with Speedometer - by Saw® - 02.02.2012, 19:41
Re: Problem with Speedometer - by GrInDzO - 03.02.2012, 12:17
Re: Problem with Speedometer - by [XST]O_x - 03.02.2012, 12:19
Re: Problem with Speedometer - by GrInDzO - 03.02.2012, 12:25
Re: Problem with Speedometer - by [XST]O_x - 03.02.2012, 12:27
Re: Problem with Speedometer - by GrInDzO - 03.02.2012, 12:28
Re: Problem with Speedometer - by GrInDzO - 08.02.2012, 20:40
Re: Problem with Speedometer - by Twinki1993 - 09.02.2012, 02:50

Forum Jump:


Users browsing this thread: 2 Guest(s)