Small Bug in kSpeedo FS
#1

I'm using this FilterScript, which works great. The only problem is that if you die when inside a vehicle, or exit the vehicle in any way other than normal, it doesn't process the players state change, thus leaving the text permanently on the screen.

https://sampforum.blast.hk/showthread.php?tid=358810&page=2
Reply
#2

Found a solution. Anybody using this FilterScript add this to it.

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    //Hide all the text draws for the player
    TextDrawHideForPlayer(playerid, speedo1[playerid]);
    TextDrawHideForPlayer(playerid, speedo2[playerid]);
    TextDrawHideForPlayer(playerid, speedo3[playerid]);
    speedo_status[playerid] = 0;
    return 1;
}
Reply
#3

Hide all the speedo's textdraws at OnPlayerDeath and other callbaks that causes the player to exit from the vehicle.
Reply
#4

As "DLR" Said,
PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    
//Hide all the text draws for the player
    
TextDrawHideForPlayer(playeridspeedo1[playerid]);
    
TextDrawHideForPlayer(playeridspeedo2[playerid]);
    
TextDrawHideForPlayer(playeridspeedo3[playerid]);
    
speedo_status[playerid] = 0;
    return 
1;

Also Use This OnPlayerStateChange,
PHP код:
public OnPlayerStateChange(playeridnewstateoldstate)
{
    if(
newstate == PLAYER_STATE_DRIVER)
    {
        
TextDrawShowForPlayer(playeridspeedo1[playerid]);
        
TextDrawShowForPlayer(playeridspeedo2[playerid]);
        
TextDrawShowForPlayer(playeridspeedo3[playerid]);
        
speedo_status[playerid] = 1;
    }
    if(
oldstate == PLAYER_STATE_DRIVER)
    {
        
TextDrawHideForPlayer(playeridspeedo1[playerid]);
        
TextDrawHideForPlayer(playeridspeedo2[playerid]);
        
TextDrawHideForPlayer(playeridspeedo3[playerid]);
        
speedo_status[playerid] = 0;
    }
    return 
1;

Reply
#5

speedo_status[playerid] is something extra I added in, because I put a /speedo command into the FilterScript also.

By default passengers can see the speedo (Which I've changed in my version), so you'd have to add checks to things like player ejecting and being teleported.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)