SetPlayerSkin freezes player if entering vehicle
#8

Who said it is not a bug? We're just trying to help you get around the bug so you can keep scripting whatever you do.

Detect if a player presses ENTER, but doesn't get in the car:

pawn Code:
forward CheckTimer(playerid);
new bool:playerenteringvehicle[MAX_PLAYERS];
pawn Code:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    playerenteringvehicle[playerid] = true;
    SetTimerEx("CheckTimer", 5000, 0, "d", playerid);
    return 1;
}
pawn Code:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER && playerenteringvehicle[playerid] == true) playerenteringvehicle[playerid] = false;
    return 1;
}
pawn Code:
public CheckTimer(playerid)
{
    if(playerenteringvehicle[playerid] == true)
    {
        playerenteringvehicle[playerid] = false;
        // Player pressed enter, but walked away. Put your code here.
    }
    return 1;
}
Edit: I know this is a bug that NEEDS to be fixed in the future versions, but as you know the client updates ain't popping up that fast, so you gotta think about ways to get around the bugs while they're still not-fixed. When the update comes out with the bug fixed, it is not that big job to remove the code you've written and use the bug-free function in happiness.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)