[FilterScript] kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED)
#6

Quote:
Originally Posted by Robert West
Посмотреть сообщение
Good , but the speed is always 0 ?

I tested this exact code and it never shows speed always 0. If that's the case, then you may have not used it right, and/or put it into a script without putting all of it in.

There's one thing you can check for, though.

This one variable here:
Код:
new Float:PlayerPos[3][MAX_PLAYERS]; //Holds the player's last posistion.
Is the magic in all of this.

Make sure of the following:

OnPlayerUpdate:

Код:
	    new Float:x, Float:y, Float:z;
	    GetPlayerPos(playerid, x, y, z);
	    format(string, sizeof(string), "Gas: ~%s~%d \%", FuelColor(vid), CarFuel[vid]);
	    TextDrawSetString(speedo4[playerid], string);
	    new distance = GetDistance(x, y, z, PlayerPos[0][playerid], PlayerPos[1][playerid], PlayerPos[2][playerid]);
	    PlayerPos[0][playerid] = x;
	    PlayerPos[1][playerid] = y;
	    PlayerPos[2][playerid] = z;
Make sure you are setting the variables.


And, OnPlayerStateChange, when the player enters a vehicle:
Код:
		new Float:x, Float:y, Float:z;
		GetPlayerPos(playerid, x, y, z);
		PlayerPos[0][playerid] = x;
		PlayerPos[1][playerid] = y;
		PlayerPos[2][playerid] = z;
Make sure that is used to prevent a large jump from (0,0,0)

3D text labels weren't done because I feel that a Text Draw for a speedometer is a better idea than the 3D text label, even connected to a vehicle. You're free to do it that way for your personal use, but I'm not going to do it.

And, as a note, I'm going to use this Speedo in my next GM - a San Fierro "Light Role Play".
Reply


Messages In This Thread
kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Karagon - 11.07.2012, 19:13
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by 'seraphin - 11.07.2012, 19:26
Respuesta: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Gamer_007 - 15.07.2012, 08:06
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Robert West - 15.07.2012, 08:17
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by shayan122 - 15.07.2012, 15:12
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Karagon - 17.07.2012, 15:43
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Koske - 17.07.2012, 18:51
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Karagon - 19.07.2012, 01:33
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Robert West - 19.07.2012, 05:28
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Igi_Guduric - 19.07.2012, 05:52
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Plovix - 19.07.2012, 07:51
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by $$inSane - 19.07.2012, 09:01
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by jimbo8 - 23.07.2012, 10:24
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Cypress - 23.07.2012, 10:47
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Plovix - 23.07.2012, 11:19
Respuesta: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by [Nikolay] - 26.07.2012, 13:15
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by xxXSniperShotXxx - 24.12.2012, 19:18
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Xlithan - 13.01.2013, 00:31
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by DLR - 11.02.2013, 13:27
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Spawe - 09.10.2018, 21:00
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by RatDimo - 10.10.2018, 01:04
Re: kSpeedo - Speedometer with Health, Fuel, and Vehicle Name (COLOR CODED) - by Spawe - 15.10.2018, 22:07

Forum Jump:


Users browsing this thread: 1 Guest(s)