SpeedoMeter Help
#1

We created a Speedometer all goes well, unless you get out of the car, does not disappear ...
Can someone help?

SpeedoMeter: http://pastebin.com/1J1mwB7p
Reply
#2

Hide the speedo when the player leaves the car:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
        if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
        {
              Hide the shit here : )))
        }
        return 1;
}
Reply
#3

We failed
Do not you do it please?
And you put it on pastebin
Reply
#4

Nope i won't, but if you go into the filterscript section you will find what you are looking for.
Reply
#5

I do not know what to put where you write that: Hide the shit here : )))
Reply
#6

pawn Код:
public Speedo()
{
    new Float:Speedo_HP;

    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            new vehicle = GetPlayerVehicleID(i);
            GetVehicleHealth(vehicle, Speedo_HP);
            new Float:X, Float:Y, Float:Z, Float:Sp;
            GetVehicleVelocity(vehicle, X, Y, Z);
            Sp = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 100.0);
            Speed[i]=floatround(floatdiv(Sp, 0.75), floatround_floor);

            if(SpeedoON[i] == 0)
            {
                TextDrawShowForPlayer(i, Speedd[i]);
                TextDrawShowForPlayer(i, Vehicle[i]);
                TextDrawShowForPlayer(i, Health[i]);
                SpeedoON[i] = 1;
            }
            new string[128];
            format(string,sizeof(string),"Masina: %s",VehicleNames[GetVehicleModel(vehicle)-400]);
            TextDrawSetString(Vehicle[i], string);
            format(string,sizeof(string),"Viteza: %dmp/h",Speed[i]);
            TextDrawSetString(Speedd[i], string);
            format(string,sizeof(string),"Viata: %.2f", Speedo_HP);
            TextDrawSetString(Health[i], string);
        }
        else if(SpeedoON[i] == 1)
        {
            TextDrawHideForPlayer(i, Speedd[i]);
            TextDrawHideForPlayer(i, Vehicle[i]);
            TextDrawHideForPlayer(i, Health[i]);
            SpeedoON[i] = 0;
        }
    }
}
Also, you don't need to create 3 strings.
Reply
#7

Quote:
Originally Posted by MadeMan
Посмотреть сообщение
pawn Код:
public Speedo()
{
    new Float:Speedo_HP;

    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInAnyVehicle(i))
        {
            new vehicle = GetPlayerVehicleID(i);
            GetVehicleHealth(vehicle, Speedo_HP);
            new Float:X, Float:Y, Float:Z, Float:Sp;
            GetVehicleVelocity(vehicle, X, Y, Z);
            Sp = floatmul(floatsqroot(floatadd(floatadd(floatpower(X, 2), floatpower(Y, 2)),  floatpower(Z, 2))), 100.0);
            Speed[i]=floatround(floatdiv(Sp, 0.75), floatround_floor);

            if(SpeedoON[i] == 0)
            {
                TextDrawShowForPlayer(i, Speedd[i]);
                TextDrawShowForPlayer(i, Vehicle[i]);
                TextDrawShowForPlayer(i, Health[i]);
                SpeedoON[i] = 1;
            }
            new string[128];
            format(string,sizeof(string),"Masina: %s",VehicleNames[GetVehicleModel(vehicle)-400]);
            TextDrawSetString(Vehicle[i], string);
            format(string,sizeof(string),"Viteza: %dmp/h",Speed[i]);
            TextDrawSetString(Speedd[i], string);
            format(string,sizeof(string),"Viata: %.2f", Speedo_HP);
            TextDrawSetString(Health[i], string);
        }
        else if(SpeedoON[i] == 1)
        {
            TextDrawHideForPlayer(i, Speedd[i]);
            TextDrawHideForPlayer(i, Vehicle[i]);
            TextDrawHideForPlayer(i, Health[i]);
            SpeedoON[i] = 0;
        }
    }
}
Also, you don't need to create 3 strings.
Thanks very much
I solved with your help
Thanks
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)