Vehicle Speed Problem
#1

Hi, i have a problem with speedometer.
On server is 2 players "x" and "y", if "x" is in a vehicle speed is indicated good but when "y" enter in a vehicle speed is blocked at both of them or speed of "x" shows to "y".

Код:
public OnVehicleSpeedChange(vehicleid, newspeed, oldspeed)
{
	new string[256];
	for(new i=0; i <MAX_PLAYERS; i++)
	{
	    if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
		{
	        new mph = newspeed;
	        format(string, sizeof(string), "~g~KMH: ~w~%d   ~g~MPH: ~w~%d",newspeed,mph);
			TextDrawSetString(Lmph[i], string);
			TextDrawShowForPlayer(i, Lmph[i]);
			TextDrawShowForPlayer(i, Lmph[i]);
			TextDrawShowForPlayer(i, Lmph[i]);
			break;
	    }
	}
	return 1;
}
Sorry for bad english...
Reply
#2

pawn Код:
break;
Do you even know what does it do?

Delete it.
Reply
#3

Quote:
Originally Posted by [MG]Dimi
Посмотреть сообщение
pawn Код:
break;
Do you even know what does it do?

Delete it.
Don't work... same problem.
Reply
#4

Just define if player is driver and show speed just for him ?
Reply
#5

Why in the hell you want show car speed from 1 car to all players who is in car at all?

Just make that it checks if(vehicleid == GetPlayerVehicleID(playerid) && GetPlayerState= PLAYER_STATE_DRIVER)
Reply
#6

It's woooorking!Thanks to all!

Special thanks to ikey07
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)