17.02.2014, 00:43
Codigos agora entro no carro e nao aparece
Observe coloquei todas new !
Observe coloquei todas new !
PHP код:
public Velocimetro()
{
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,SavePlayerPosV[i][sY])),2)+floatpower(floatabs(floatsub(Speedo_Z,SavePlayerPosV[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, tacho[i]);
TextDrawShowForPlayer(i, fahrzeug[i]);
TextDrawShowForPlayer(i, kmh[i]);
TextDrawShowForPlayer(i, hoehe[i]);
TextDrawShowForPlayer(i, zustand[i]);
TextDrawHideForPlayer(i, forum[i]);
}
new kmh_anzahl = floatround(value/1600);
format(str1,sizeof(str1),"~d~ Veiculo: ~p~%s ~n~~n~~n~ ~g~|~y~|~b~|~w~www.~g~brasil~y~style~b~city~w~.com~g~|~y~|~b~|",vehName[GetVehicleModel(GetPlayerVehicleID(i))-400]);
TextDrawSetString(fahrzeug[i], str1);
if(kmh_anzahl >= 150)
{
format(str2,sizeof(str2),"~d~ KM/H: ~g~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 100)
{
format(str2,sizeof(str2),"~d~ KM/H: ~g~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else if(kmh_anzahl >= 50)
{
format(str2,sizeof(str2),"~d~ KM/H: ~g~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
else
{
format(str2,sizeof(str2),"~d~ KM/H: ~g~%d",kmh_anzahl);
TextDrawSetString(kmh[i], str2);
}
format(str3,sizeof(str3),"~d~ Combustivel: ~p~%d%", Gas[vehicle]);
TextDrawSetString(hoehe[i], str3);
if(Speedo_HP >= 551)
{
format(str4,sizeof(str4),"~d~ Lataria: ~y~%0.0f%%", Speedo_HP/10);
TextDrawSetString(zustand[i], str4);
}
else if(Speedo_HP >= 361)
{
format(str4,sizeof(str4),"~d~ Lataria: ~y~%0.0f%%", Speedo_HP/10);
TextDrawSetString(zustand[i], str4);
}
else if(Speedo_HP >= 250)
{
format(str4,sizeof(str4),"~d~ Lataria: ~y~%0.0f%%", Speedo_HP/10);
TextDrawSetString(zustand[i], str4);
}
else
{
format(str4,sizeof(str4),"~d~ Lataria: ~y~%0.0f%%", Speedo_HP/10);
TextDrawSetString(zustand[i], str4);
}
}
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, fahrzeug[i]); TextDrawHideForPlayer(i, kmh[i]);
TextDrawHideForPlayer(i, hoehe[i]); TextDrawHideForPlayer(i, zustand[i]);TextDrawShowForPlayer(i, forum[i]);
SpeedoON[i] = 0;
}
}
}