Posts: 1,290
Threads: 69
Joined: Dec 2006
Reputation:
0
Well as the title says. If SetPlayerSkin is used when a player is entering a vehicle the player will become frozen (like TogglePlayerControllable) I know the easy solution is to not set a player's skin when they are entering a vehicle but there is no way of detecting if a player is entering a vehicle or not. SetPlayerSkin also freezes a player if they are jumping.
Posts: 300
Threads: 5
Joined: Jan 2007
Reputation:
0
So? You don't need OnPlayerStateChange, before you set the skin, just use GetPlayerState, if they're entering a vehicle, cancel the skin change or unfreeze them after the skin has been set.
Posts: 1,290
Threads: 69
Joined: Dec 2006
Reputation:
0
When I said they aren't used in OnPlayerStateChange I meant GetPlayerState too
Posts: 1,464
Threads: 11
Joined: Jan 2008
Reputation:
0
Yes they do.
OnPlayerEnterVehicle is called when player presses ENTER and starts running towards the vehicle and player's state is changed to PLAYER_STATE_DRIVER when the player is in the vehicle.
If you mean SetPlayerSkin freezes the player when pressing ENTER, just check that OnPlayerEnterVehicle-callback hasn't been called, if it has, don't let him change the skin.
If you mean it freezes when the player is inside the vehicle, do the same thing with OnPlayerStateChange and PLAYER_STATE_DRIVER.
Posts: 1,290
Threads: 69
Joined: Dec 2006
Reputation:
0
I know this topic hasn't been posted in for a while, I didn't think it was worth making a new topic though. SetPlayerSkin also freezes the player if they are exiting a vehicle.
You can now detect if a player is entering a vehicle using GetPlayerSpecialAction and SPECIAL_ACTION_ENTER_VEHICLE. There is also SPECIAL_ACTION_EXIT_VEHICLE for exiting a vehicle but that doesn't seem to work in 0.3.