All pastes #982526 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-12 17:26 UTC
rendered paste body
TextDrawAlignment(Textdraw,0)
TextDrawBackgroundColor(Textdraw,0x000000ff)
TextDrawFont(Textdraw,0)
TextDrawLetterSize(Textdraw,1.000000,2.000000)
TextDrawColor(Textdraw,0xffffffff)
TextDrawSetProportional(Textdraw,1)
TextDrawSetShadow(Textdraw,1)

//speedo -- a timer that works every sec... 
public CheckSpeedo()
{

	new speedstring[100];
	
	for(new i=0;i<MAX_PLAYERS;i++)
	{
		if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
		{
			if(speedo[i] == 1 && CountX == 5)
			{
		        new Float:x,Float:y,Float:z;
	            new Float:distance,value;
	            GetPlayerPos(i, x, y, z);
	            distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
	            value = floatround(distance * 11000);
	            format(speedstring, sizeof(speedstring), "~n~~n~~n~~n~~n~~n~~n~~n~~n~ ~n~ ~r~Vehicle: ~g~%s~n~ ~b~Km/H: ~g~%d",carname[GetVehicleModel(GetPlayerVehicleID(i))-400],floatround(value/1400));
                GameTextForPlayer(i, speedstring, 30000, 3);
				SavePlayerPos[i][LastX] = x;
	            SavePlayerPos[i][LastY] = y;
	            SavePlayerPos[i][LastZ] = z;
			}
			if(speedo[i] == 2 && CountX == 5)
			{
		        new Float:x,Float:y,Float:z;
	            new Float:distance,value;
	            GetPlayerPos(i, x, y, z);
	            distance = floatsqroot(floatpower(floatabs(floatsub(x,SavePlayerPos[i][LastX])),2)+floatpower(floatabs(floatsub(y,SavePlayerPos[i][LastY])),2)+floatpower(floatabs(floatsub(z,SavePlayerPos[i][LastZ])),2));
	            value = floatround(distance * 11000);
	            format(speedstring, sizeof(speedstring), "~n~~n~~n~~n~~n~~n~~n~~n~~n~ ~n~ ~r~Vehicle: ~g~%s ~n~ ~b~Km/H: ~g~%d",carname[GetVehicleModel(GetPlayerVehicleID(i))-400],floatround(value/1400));
				GameTextForPlayer(i, speedstring, 30000, 3);
				SavePlayerPos[i][LastX] = x;
	            SavePlayerPos[i][LastY] = y;
	            SavePlayerPos[i][LastZ] = z;
			}
		}
	}
		
	return 1;
}