Posts: 1,648
Threads: 482
Joined: Jun 2010
Quote:
Originally Posted by park4bmx
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 player id so you dont have to loop through all players creating more lag becouse the timers is running at 300 every milisecond and if you add the [b]loop[/u] that will eat alot of cpu mem. will cause lagg!
|
Yes, I done that for testing purposes, I originally had what you showed me. The issue is not resolved, the first player that logs in and goes to a vehicle and types /eon gets this display:
SPEED: 0MPH (Not moving yet).
Fuel: 17%(or whatever the fuel is).
Second person logs in, goes to a vehicle and gets this.
FUEL: 17%.
No SPEED:
It's the same for any vehicle and any other player except the first one to hit the command.