GetPlayerState Returning 0 While At Class Selection - 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: GetPlayerState Returning 0 While At Class Selection (
/showthread.php?tid=73814)
GetPlayerState Returning 0 While At Class Selection -
1337pr0 - 18.04.2009
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.
Re: GetPlayerState Returning 0 While At Class Selection -
Joe Staff - 18.04.2009
OnPlayerUpdate is returning 0, fix it.
Re: GetPlayerState Returning 0 While At Class Selection -
beckzy - 18.04.2009
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;
Re: GetPlayerState Returning 0 While At Class Selection -
1337pr0 - 18.04.2009
Quote:
Originally Posted by SilentHuntR
OnPlayerUpdate is returning 0, fix it.
|
Thanks ^^
I remember what happened now =]