SA-MP Forums Archive
OnPlayerStateChange? - 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: OnPlayerStateChange? (/showthread.php?tid=204190)



OnPlayerStateChange? - <Weponz> - 29.12.2010

I have a plane system,When you fly into a checkpoint u do a flight but if there is a passenger they also do the flight (Like there the pilot)

Can i use OnPlayerStateChange so only only drivers can do stuff and i can just if passenger return 0;?

Any help?


Re: OnPlayerStateChange? - ToPhrESH - 29.12.2010

I think you can


Re: OnPlayerStateChange? - <Weponz> - 29.12.2010

is there like IsPlayerDriver? and IsPlayerPassenger functions :S

IDK were to start to search it xD


Re: OnPlayerStateChange? - The_Gangstas - 29.12.2010

https://sampwiki.blast.hk/wiki/GetPlayerState

https://sampwiki.blast.hk/wiki/Playerstates

pawn Код:
if(newstate == statehere)
//or
if(oldstate == statehere)

if(newstate == statehere && oldstate == statehere)
if(newstate == statehere || oldstate == statehere)
//etc



Re: OnPlayerStateChange? - <Weponz> - 29.12.2010

pawn Код:
if(newstate == PLAYER_STATE_PASSENGER)
{
//return nothing?
}
Will this work under OnPlayerStateChange so when there a passenger it returns nothing? Will it return nothing for passengers all the time?


Re: OnPlayerStateChange? - _rAped - 29.12.2010

Quote:
Originally Posted by <Weponz>
Посмотреть сообщение
pawn Код:
if(newstate == PLAYER_STATE_PASSENGER)
{
//return nothing?
}
Will this work under OnPlayerStateChange so when there a passenger it returns nothing? Will it return nothing for passengers all the time?
pawn Код:
if(newstate == PLAYER_STATE_PASSENGER)
{
//If player is the driver... else it returns nothing
}



Re: OnPlayerStateChange? - <Weponz> - 29.12.2010

I dont get it :S


Re: OnPlayerStateChange? - Marricio - 29.12.2010

just put return 0; cause it wont do any stuff, instead of adding it dont even add it


Re: OnPlayerStateChange? - GaGlets(R) - 29.12.2010

No! at code where player enters that checkpont - do a check :
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) {

// do a flight code.
}


Re: OnPlayerStateChange? - <Weponz> - 29.12.2010

Thankyou GaGlets®