PHP код:
public LuX_SpeedoMeterUp()
{
new Float:LPosX;
new Float:LPosY;
new Float:LPosZ;
new Float:PlayerSpeedDistance;
new value;
new Float:L_VehHealth;
new LVehicleStatus[15];
for(new i=0; i<PLAYERS; i++)
{
if(VehicleStatus[GetPlayerVehicleID(i)] == 1)
{
LVehicleStatus = "~r~Locked";
}
else
{
LVehicleStatus = "~g~Unlocked";
}
if(IsPlayerConnected(i) && GetPlayerState(i) == PLAYER_STATE_DRIVER)
{
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, LBox[i]);
TextDrawShowForPlayer(i, LLine1[i]);
TextDrawShowForPlayer(i, LLine2[i]);
TextDrawShowForPlayer(i, LLine3[i]);
TextDrawShowForPlayer(i, LLine4[i]);
TextDrawShowForPlayer(i, LCredits[i]);
TextDrawShowForPlayer(i, Lmph[i]);
TextDrawShowForPlayer(i, LFunc[i]);
LuX_SpeedoMeter[i] = 1;
}
new LMPH = floatround(value/1600);
new LKPH = floatround(value/1000);
format(lstring,sizeof(lstring),"~b~Vehicle: ~w~%s~n~~b~Health: ~w~%.2f~n~~b~Altitude: ~w~%.1f~n~~b~Gps: ~w~%s~n~~b~Status: %s",LVehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],L_VehHealth,LPosZ,LuxZone,LVehicleStatus);
TextDrawSetString(LFunc[i], lstring);
format(lstr,sizeof(lstr),"%sMPH: ~w~%d %sKM/H: ~w~%d",MPH_KPH_Color,LMPH,MPH_KPH_Color,LKPH);
TextDrawSetString(Lmph[i], lstr);
if(L_VehHealth <= 500)
{
format(lstring,sizeof(lstring),"%sVehicle: ~w~%s~n~%sHealth: ~w~~r~%.2f~n~%sAltitude: ~w~%.1f~n~%sGps: ~w~%s",CategoriesColor,LVehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],CategoriesColor,L_VehHealth,CategoriesColor,LPosZ,CategoriesColor,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<PLAYERS; i++)
{
if(!IsPlayerInAnyVehicle(i))
{
TextDrawHideForPlayer(i, LBox[i]);
TextDrawHideForPlayer(i, LLine1[i]);
TextDrawHideForPlayer(i, LLine2[i]);
TextDrawHideForPlayer(i, LLine3[i]);
TextDrawHideForPlayer(i, LLine4[i]);
TextDrawHideForPlayer(i, LCredits[i]);
TextDrawHideForPlayer(i, Lmph[i]);
TextDrawHideForPlayer(i, LFunc[i]);
LuX_SpeedoMeter[i] = 0;
}
}
return 1;
}