GetPlayerState bug
#1

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

Quote:

7 Player is wasted or on class selection - "PLAYER_STATE_WASTED"

This does not work. When i wrote

pawn Код:
if(GetPlayerState(playerid) == 7)
{
//something
}
And, if player on the class selection, nothing happens.
Reply
#2

Quote:
Originally Posted by erorcun
https://sampwiki.blast.hk/wiki/State

Quote:

7 Player is wasted or on class selection - "PLAYER_STATE_WASTED"

This does not work. When i wrote

pawn Код:
if(GetPlayerState(playerid) == 7)
{
//something
}
And, if player on the class selection, nothing happens.
Where did you place that code?
Reply
#3

I didn't put it wrong.
Reply
#4

Just tested it and it really doesn't work
Reply
#5

How about showing the full code you guys used to test it?
Reply
#6

pawn Код:
public OnPlayerUpdate(playerid)
{
    if (GetPlayerState(playerid) == PLAYER_STATE_WASTED) printf("PLAYER_STATE_WASTED OnPlayerUpdate");
    return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
    if (GetPlayerState(playerid) == PLAYER_STATE_WASTED) printf("PLAYER_STATE_WASTED OnPlayerRequestClass");
    return 1;
}
and not a single print
Reply
#7

Could it be that that state is similar to the enter/exit vehicle states (They are only used internally, and never get returned in things like GetPlayerState)?
Reply
#8

When you die or select class, callback OnPlayerUpdate doesn't calling.
Reply
#9

"PLAYER_STATE_WASTED" is only after F4 /kill. First class selection after connect is "PLAYER_STATE_NONE".
Reply
#10

Well, It didn't get called when I was randomly going through skins on skin selection, it didn't get called when I spawned (OnPlayerRequestSpawn) and it didn't get called when I killed myself via SetPlayerHealth(playerid, 0.0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)