Jump to content
  • 0

Ajutor Speedometer


Issey

Question

Problema intalnita (descriere):Deci , folosesc atat speedometer-ul Lux cat si unul din GM , speedometer-ul lux merge bine , apare in orice masina as fi , dar cel din GM nu, apare la primele 500-600 de masini , iar la restul pana la 1000 nu apare ..si nu stiu de ce
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul(obligatoriu):-
Imagini / Video (optional):-
Ati incercat sa rezolvati singur?: da

 

asta e din FS :

public LuX_SpeedoMeterUp()
{
    new Float:LPosX;
	new Float:LPosY;
	new Float:LPosZ;
	new Float:PlayerSpeedDistance;
	new value;
	new Float:L_VehHealth;
	
	for(new i=0; i<MAX_PLAYERS; i++)
	{
	if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
	{
 	GetPlayerPos(i, LPosX, LPosY, LPosZ);
	GetPlayerVehicleID(i);
	GetVehicleHealth(GetPlayerVehicleID(i), L_VehHealth);
	PlayerSpeedDistance = floatsqroot(floatpower(floatabs(floatsub(LPosX,LuX_ReadPlayerPosition[i][ReadX])),2)+floatpower(floatabs(floatsub(LPosY,LuX_ReadPlayerPosition[i][ReadY])),2)+floatpower(floatabs(floatsub(LPosZ,LuX_ReadPlayerPosition[i][ReadZ])),2));
	value = floatround(PlayerSpeedDistance * 5000);
	new LuxZone[MAX_ZONE_NAME];
	GetPlayer2DZone(i, LuxZone, MAX_ZONE_NAME);
	if(LuX_SpeedoMeter[i] == 0){
    TextDrawShowForPlayer(i, LFunc[i]);
	LuX_SpeedoMeter[i] = 1;	}
	
	format(lstring,sizeof(lstring),"~b~Vehicul: ~w~%s~n~~b~HP: ~w~%.2f~n~~b~Altitudine: ~w~%.1f~n~~b~Gps: ~w~%s",LVehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],L_VehHealth,LPosZ,LuxZone);
	TextDrawSetString(LFunc[i], lstring);

	}
	LuX_ReadPlayerPosition[i][ReadX] = LPosX, LuX_ReadPlayerPosition[i][ReadY] = LPosY, LuX_ReadPlayerPosition[i][ReadZ] = LPosZ;}
	for(new i=0; i<MAX_PLAYERS; i++){
	if(!IsPlayerInAnyVehicle(i)){
	TextDrawHideForPlayer(i, LFunc[i]);
	LuX_SpeedoMeter[i] = 0;
	}
	}
	return 1;
}

si asta din GM :

public CheckCar()
{
	for(new i=0;i<MAX_PLAYERS;i++)
	{
		new string[256];
 		if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
		{
			new car = GetPlayerVehicleID(i);
	    	new Speed = GetSpeed(i);
	    	TextDrawHideForPlayer(i, TextDrawCar[i][1]);
	    	TextDrawHideForPlayer(i, TextDrawCar[i][2]);
	    	TextDrawHideForPlayer(i, Box[i]);
    		TextDrawHideForPlayer(i, Line1[i]);
	    	TextDrawHideForPlayer(i, Line2[i]);
	    	TextDrawHideForPlayer(i, Line3[i]);
	    	TextDrawHideForPlayer(i, Line4[i]);
	    	format(string, sizeof(string), "Fuel: %d%", Gas[car]);
	    	TextDrawSetString(TextDrawCar[i][1], string);
	    	format(string, sizeof(string), "Km/h: %d", Speed);
			TextDrawSetString(TextDrawCar[i][2], string);
			TextDrawShowForPlayer(i, TextDrawCar[i][1]);
			TextDrawShowForPlayer(i, TextDrawCar[i][2]);
			TextDrawShowForPlayer(i, Line1[i]);
			TextDrawShowForPlayer(i, Line2[i]);
			TextDrawShowForPlayer(i, Line3[i]);
			TextDrawShowForPlayer(i, Line4[i]);
			TextDrawShowForPlayer(i, Box[i]);
		}
		else
		{
			//KillTimer(checkcartimer);
			TextDrawHideForPlayer(i, TextDrawCar[i][1]);
		    TextDrawHideForPlayer(i, TextDrawCar[i][2]);
		    TextDrawHideForPlayer(i, Box[i]);
		    TextDrawHideForPlayer(i, Line1[i]);
	    	TextDrawHideForPlayer(i, Line2[i]);
	    	TextDrawHideForPlayer(i, Line3[i]);
	    	TextDrawHideForPlayer(i, Line4[i]);
		}
	}
	return 1;
}

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.