SA-MP Forums Archive
Issue with speedo not hiding OnPlayerExitVehicle. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Issue with speedo not hiding OnPlayerExitVehicle. (/showthread.php?tid=359603)



Issue with speedo not hiding OnPlayerExitVehicle. - Dokins - 14.07.2012

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?


Re: Issue with speedo not hiding OnPlayerExitVehicle. - Captain_Mani - 14.07.2012

Try

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



Re: Issue with speedo not hiding OnPlayerExitVehicle. - Dokins - 14.07.2012

Alright, I'll give it a try.

EDIT: Didn't work.


Re: Issue with speedo not hiding OnPlayerExitVehicle. - Dokins - 14.07.2012

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


Re: Issue with speedo not hiding OnPlayerExitVehicle. - Revo - 15.07.2012

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.


Re: Issue with speedo not hiding OnPlayerExitVehicle. - FUNExtreme - 15.07.2012

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


Re: Issue with speedo not hiding OnPlayerExitVehicle. - StrangeLove - 15.07.2012

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


Re: Issue with speedo not hiding OnPlayerExitVehicle. - Captain_Mani - 15.07.2012

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.