GetPlayerState Returning 0 While At Class Selection
#1

Hi

For some reason, nobody on my server can see anyone else, and while players are at class selection, GetPlayerState is returning 0, when it should be returning 7. See https://sampwiki.blast.hk/wiki/Playerstates - "7 Player is wasted or on class selection".

Sounds like a bug to me, but maybe something else is causing this. It only started doing it today, when I applied an update completely unrelated to player states.

Can anyone help?

Thanks.
Reply
#2

OnPlayerUpdate is returning 0, fix it.
Reply
#3

It does return 7 after you have died and gone back to class selection but when you connect it is 0 because the state is set when the player spawns.

You could get around it with something like this:

Код:
new bool:gstate[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
  gstate[playerid] = false;
}

public OnPlayerRequestClass(playerid)
{
  gstate[playerid] = true;
}

public OnPlayerSpawn(playerid)
{
  gstate[playerid] = false;
}
Код:
GetPlayerState2(playerid) return !gstate[playerid] ? GetPlayerState(playerid) : 7;
Reply
#4

Quote:
Originally Posted by SilentHuntR
OnPlayerUpdate is returning 0, fix it.
Thanks ^^

I remember what happened now =]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)