02.03.2014, 00:19
Hi Scripterzzz.I have problem with my Speedometer ... i maked it t.e edit from LuX and yesterday it working but now not working
why ??
repping please
pawn Код:
format(lstr,sizeof(lstr)," ~w~%d",GetPlayerSpeed(i));
TextDrawSetString(Lmph[i], lstr);
pawn Код:
stock GetPlayerSpeed(playerid)
{
if(playerid != INVALID_PLAYER_ID)
{
new Float:Pos[3],Float:PS;
GetPlayerVelocity(playerid, Pos[0], Pos[1], Pos[2]);
PS = floatsqroot(Pos[0]*Pos[0] + Pos[1]*Pos[1] + Pos[2]*Pos[2])*200;
return floatround(PS,floatround_round);
}
return INVALID_PLAYER_ID;
}
pawn Код:
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<MAX_PLAYERS; i++)
{
if(VehicleStatus[GetPlayerVehicleID(i)] == 1)
{
LVehicleStatus = "~r~Zakluceno";
}
else
{
LVehicleStatus = "~g~Otkluceno";
}
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, 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]);
Gas[GetPlayerVehicleID(i)] = 100;
LuX_SpeedoMeter[i] = 1; }
//------------------------------------------------------------------------------
format(lstring,sizeof(lstring),"~b~Vozilo: ~w~%s~n~~b~Jacina: ~w~%.2f~n~~b~Gorivo: ~w~%d litri~n~~b~KM: ~w~1~n~~g~Registrirano~n~~b~Lokacija GPS: ~n~~w~%s",LVehiclesName[GetVehicleModel(GetPlayerVehicleID(i))-400],L_VehHealth,Gas[GetPlayerVehicleID(i)],LuxZone);
TextDrawSetString(LFunc[i], lstring);
//------------------------------------------------------------------------------
format(lstr,sizeof(lstr)," ~w~%d",GetPlayerSpeed(i));
TextDrawSetString(Lmph[i], lstr);
//------------------------------------------------------------------------------
}
//------------------------------------------------------------------------------
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, 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;
}