Speedometer only displays to 1st person joining server.
#3

well...

you have this
pawn Code:
SpeedoSysTimer[playerid] = SetTimerEx("SpeedoUpdate", 800, true, "i", playerid);
which you farward the playerid so why not use it ? instead your making more lag !

pawn Code:
public SpeedoUpdate(playerid)
{
 if(IsPlayerInAnyVehicle(playerid))
        {
            new Float:x,Float:y,Float:z,string[24],vehicleid = GetPlayerVehicleID(playerid);
            GetVehicleVelocity(vehicleid,x,y,z);
            format(string,sizeof(string),"~g~Speed: ~w~%d mph",floatround(floatsqroot(((x*x)+(y*y))+(z*z))*156.666667*0.641371192));
            TextDrawSetString(speed[playerid],string);
            format(string,sizeof(string),"~g~Fuel: ~w~%d%%",VehFuel[vehicleid]);
            TextDrawSetString(fuel[playerid],string);
        }

}
Explained

as you have a cmd to turn on the speedo , etc..
just forward the playerid so you don't have to loop through all players creating more lag because the timers is running at 300 every millisecond for nearly every player on the server and if you add the loop that will eat a lot of CPU mem. will cause lag!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)