[Ajuda] Velocimetro
#1

Galera Boa tarde й o seguinte,no meu servidor tenho os veiculos vips certo,qnd compro o velocimetro fica parado na lataria 98% e gasolina 98% tambem,nas orgs й tudo normal sу nos carros vips


Me ajudem Obrigado


Quote:

public AtualizarVeloCaio(playerid)
{
new Float:Speedo_X,Float:Speedo_Y,Float:Speedo_Z;
new Float:PlayerSpeedDistance,value;
new Float:Speedo_HP;


for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerInAnyVehicle(i))
{
GetPlayerPos(i, Speedo_X, Speedo_Y, Speedo_Z);
GetPlayerVehicleID(i);
GetVehicleHealth(GetPlayerVehicleID(i), Speedo_HP);
PlayerSpeedDistance = floatsqroot(floatpower(floatabs(floatsub(Speedo_X, SavePlayerPosV[i][sX])),2)+floatpower(floatabs(floatsub(Speedo_Y,SavePl ayerPosV[i][sY])),2)+floatpower(floatabs(floatsub(Speedo_Z,SavePl ayerPosV[i][sZ])),2));
value = floatround(PlayerSpeedDistance * 5000);
new vehicle = GetPlayerVehicleID(i);
new str1[256],str2[256],str3[256],str4[256];
if(SpeedoON[i] == 0)
{
TextDrawShowForPlayer(i, box[i]);
TextDrawShowForPlayer(i, fahrzeug[i]);
TextDrawShowForPlayer(i, kmh[i]);
TextDrawShowForPlayer(i, hoehe[i]);
TextDrawShowForPlayer(i, zustand[i]);
TextDrawShowForPlayer(i, url[i]);
SpeedoON[i] = 1;
}
new kmh_anzahl = floatround(value/1600);

format(str1,sizeof(str1),"~d~Modelo~y~: ~p~%s(%i)",vehName[GetVehicleModel(GetPlayerVehicleID(i))-400],GetVehicleModel(vehicle));
TextDrawSetString(fahrzeug[i], str1);

if(GetPlayerSpeed(i, true) >= 150)
{
format(str2,sizeof(str2),"~d~KM/H~y~: ~r~%d",GetPlayerSpeed(i, true));
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 100)
{
format(str2,sizeof(str2),"~d~KM/H: ~y~%d",GetPlayerSpeed(i, true));
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 50)
{
format(str2,sizeof(str2),"~d~KM/H~y~: ~g~%d",GetPlayerSpeed(i, true));
TextDrawSetString(kmh[i], str2);
}
else
{
format(str2,sizeof(str2),"~d~KM/H~y~: ~p~%d",GetPlayerSpeed(i, true));
TextDrawSetString(kmh[i], str2);
}

format(str3,sizeof(str3),"~d~Gasolina~y~: ~p~%d%", Gas[vehicle]);
TextDrawSetString(hoehe[i], str3);

if(Speedo_HP >= 551)
{
format(str4,sizeof(str4),"~d~Saude~y~: ~p~%0.0f%%", Speedo_HP/10);
TextDrawSetString(zustand[i], str4);
}
else if(Speedo_HP >= 361)
{
format(str4,sizeof(str4),"~d~Saъde~y~: ~p~%0.0f%%", Speedo_HP/10);
TextDrawSetString(zustand[i], str4);
}
else
{
format(str4,sizeof(str4),"~d~Saude~y~: ~p~%0.0f%%", Speedo_HP/10);
TextDrawSetString(zustand[i], str4);
}
TextDrawSetString(url[i], URL);
}
SavePlayerPosV[i][sX] = Speedo_X, SavePlayerPosV[i][sY] = Speedo_Y, SavePlayerPosV[i][sZ] = Speedo_Z;
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, box[i]); TextDrawHideForPlayer(i, tacho[i]); TextDrawHideForPlayer(i, fahrzeug[i]); TextDrawHideForPlayer(i, kmh[i]);
TextDrawHideForPlayer(i, hoehe[i]); TextDrawHideForPlayer(i, zustand[i]); TextDrawHideForPlayer(i, url[i]);
SpeedoON[i] = 0;
}
}
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(spawnado[i] == 1)
{
if(SpeedoON[i] == 1)
{
TextDrawHideForPlayer(i, forum[i]);
}
if(SpeedoON[i] == 0)
{
TextDrawShowForPlayer(i, forum[i]);
}
}
}
}
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)