14.12.2009, 16:55
I wanna be able to get the players old state like this:
How to do this?
pawn Код:
if(GetPlayerOldState(playerid) == PLAYER_STATE_DRIVER)
if(GetPlayerOldState(playerid) == PLAYER_STATE_DRIVER)
if(oldstate == PLAYER_STATE_DRIVER)
|
Originally Posted by Martin_M
Код:
if(oldstate == PLAYER_STATE_DRIVER) |
switch(oldstate)
public OnPlayerStateChange(playerid,newstate,oldstate)
{
if(oldstate == PLAYER_STATE_DRIVER) // If i changed my state, and changed from driver to something else
{ // Then..
// Something happens
}
return 1; // OnPlayerStateChange callback return
} // Closing OnPlayerStateChange callback.
switch(oldstate)
{
case PLAYER_STATE_DRIVER: { /*something*/ }
case PLAYER_STATE_PASSENGER: { /*something else*/ }
}
|
Originally Posted by lrZ^ aka LarzI
No you don't need a switch statement.
Switch statements are only useful if you want to check for if var is equal to more than one value Example pawn Код:
|