08.02.2018, 14:28
Move your code from OnPlayerKeyStateChange to OnPlayerStateChange, Check if the player's state changes from PLAYER_STATE_DRIVER to PLAYER_STATE_ONFOOT
PHP код:
if(oldstate == PLAYER_STATE_DRIVER && newstate == PLAYER_STATE_ONFOOT)
{
// Your code here
}