Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
If i off TogglePlayerSpectating and on in one moment onplayerspawn will by called or no?
Posts: 727
Threads: 111
Joined: May 2011
Reputation:
0
Hi. I don't understand your question.
If TogglePlayerSpectating is true and you try to call OnPlayerSpawn. No it will not work. You have to TogglePlayerSpectating to false.
If you're asking if TogglePlayerSpectating equal to true can be set by onplayerspawn. Yes that's true. But you'd have to set it to false somewhere in order for players to walk around.
If you're asking if TogglePlayerSpectating equal to false can be set onplayerspawn. I don't believe so. You have to set it to something else because when in spectating mode you can't select spawn. Therefore you can't spawn.
Hope this has answered your question.
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
If the player spawns, then yes.
Posts: 723
Threads: 366
Joined: Jun 2016
My code looks like that:
Код:
OnPlayerStateChange
if(newstate == PLAYER_STATE_ONFOOT )
{
TogglePlayerSpectating(playerid, 0);
TogglePlayerSpectating(playerid, 1);
}
So this can run onplayerspawn?