speedo and fuel problem
#1

I found the problem, i changed it to per-player variables.
Reply
#2

Try just GetPlayerState.
pawn Код:
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            new string[128], speed = GetVehicleSpeed(GetPlayerVehicleID(playerid), 0);
            format(string, sizeof(string), "~g~Fuel: ~w~%d", Fuel[vehicleid]);
            TextDrawSetString(FuelTD, string);
              TextDrawShowForPlayer(playerid, FuelTD);
            format(string, sizeof(string), "~r~KPH: ~w~%d", speed);
            TextDrawSetString(SpeedoTD, string);
              TextDrawShowForPlayer(playerid, SpeedoTD);

        }
Reply
#3

What i mean is, the script is sending all of the drivers speeds and fuel to all drivers so if one person was going 90 kph, other 130 kph, and another 30 kph, the drivers would keep getting 90, 130, and 30 kph on their speedometers
Reply
#4

I recommend you not to use 'OnPlayerUpdate' for fuel/speedometer functions. Use a timer which repeats always where you can update the textdraws according to speed.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)