Issue with speedo not hiding OnPlayerExitVehicle.
#1

Everytime I exit a vehicle or am teleported away or something, the speedo and fuel meter remains.

The code I have is this:
pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    TextDrawHideForPlayer(playerid,speed[playerid]);
    TextDrawHideForPlayer(playerid,fuel[playerid]);
    return 1;
}
pawn Код:
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
    {
        VehicleSQLID[vehicleid] = MySQL_GetValue(VehicleSQLID[vehicleid], "id", "vehicles");
        MySQL_SetInteger(VehicleSQLID[vehicleid], "VehFuel", VehFuel[vehicleid], "vehicles");
        if(EngineStartStatus[vehicleid] == 0)
        {
            KillTimer(SpeedoSysTimer[playerid]);
            KillTimer(FuelSysTimer[playerid]);
        }
        TextDrawDestroy(enginestring);
        TextDrawHideForPlayer(playerid, enginestring);
        TextDrawHideForPlayer(playerid,speed[playerid]);
        TextDrawHideForPlayer(playerid,fuel[playerid]);
    }
   
    return 1;
}
Now, that should cover it, right?
Reply
#2

Try

Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    TextDrawHideForPlayer(playerid,speed[playerid]);
    TextDrawHideForPlayer(playerid,fuel[playerid]);
    return 0;
}
Reply
#3

Alright, I'll give it a try.

EDIT: Didn't work.
Reply
#4

Sorry for double post, but anyone else got any suggestions?
Reply
#5

Quote:
Originally Posted by Captain_Mani
Посмотреть сообщение
Try

Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
    TextDrawHideForPlayer(playerid,speed[playerid]);
    TextDrawHideForPlayer(playerid,fuel[playerid]);
    return 0;
}
You really shouldn't help people if you have no idea of the PAWN language.
Reply
#6

That should be working. Show me how you create the textdraw but I assume that'll be correct aswell.
You sure you are using the latest version you compiled, a simple mistake that can happen to everone is loading the wrong version
Reply
#7

Try this:
pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
    {
        // Your code
    } else {
        // Your code that hides the texdraw
    }
    return 1;
}
I use that on my script and runs very well
Reply
#8

Quote:
Originally Posted by BuuGhost
Посмотреть сообщение
You really shouldn't help people if you have no idea of the PAWN language.
Well I try to help people and gain my knowledge at the same time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)