Can someone tell me why you use this ? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Can someone tell me why you use this ? (
/showthread.php?tid=164292)
Can someone tell me why you use this ? -
waim - 30.07.2010
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)
Re: Can someone tell me why you use this ? -
baske007 - 30.07.2010
https://sampwiki.blast.hk/wiki/State
There you got it
State 2 is the driver of a vehicle...
Bas
Re: Can someone tell me why you use this ? - lameguy - 30.07.2010
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.
Re: Can someone tell me why you use this ? -
ikey07 - 30.07.2010
State 2 mean player is in vehicle
use PLAYER_STATE_DRIVER instead of 2
Re: Can someone tell me why you use this ? -
waim - 30.07.2010
Thank you so much Guys