Can someone tell me why you use this ?
#1

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)
Reply
#2

https://sampwiki.blast.hk/wiki/State
There you got it
State 2 is the driver of a vehicle...

Bas
Reply
#3

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.
Reply
#4

State 2 mean player is in vehicle

use PLAYER_STATE_DRIVER instead of 2
Reply
#5

Thank you so much Guys
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)