OnPlayerStateChange?
#1

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

I think you can
Reply
#3

is there like IsPlayerDriver? and IsPlayerPassenger functions :S

IDK were to start to search it xD
Reply
#4

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
Reply
#5

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?
Reply
#6

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
}
Reply
#7

I dont get it :S
Reply
#8

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

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

// do a flight code.
}
Reply
#10

Thankyou GaGlets®
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)