Posts: 192
Threads: 49
Joined: Nov 2009
Reputation:
0
Guys Can you tell Me Why We use this when we want the other players can't entrer in Admin's Vehicules
public OnPlayerStateChange(playerid, newstate, oldstate)
{
if (newstate == 2)
I mean if (newstate == 2)
Take a look at player states:
0 Empty (while initializing) - "PLAYER_STATE_NONE"
1 Player is on foot - "PLAYER_STATE_ONFOOT"
2 Player is driver of a vehicle - "PLAYER_STATE_DRIVER"
3 Player is passenger of a vehicle - "PLAYER_STATE_PASSENGER"
7 Player is wasted or on class selection - "PLAYER_STATE_WASTED"
8 Player is spawned - "PLAYER_STATE_SPAWNED"
9 Player is spectating - "PLAYER_STATE_SPECTATING"
So number 2 is driver of vehicle.
That is the reason.
[EDIT]
Correct answer was posted while i was typing, you can ignore this one.
Posts: 1,167
Threads: 57
Joined: Jul 2010
Reputation:
0
State 2 mean player is in vehicle
use PLAYER_STATE_DRIVER instead of 2