Help! OnPLayerSpawn
#1

Hello, I need your help give an example, let's say I go to the server, the window Sign in / Register below and we see 3 boxes (<<, >>, Spawn) Spawn klick when a player spawns, I can not catch up with how to make that it does not spawn for just a chat to write (for example: "Login / Register").

P.S. Use TogglePlayerSpectating etc. does not help.

Tell me what to do, thanks in advance.
Reply
#2

pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
    if( /* CHECK IF THEY DID NOT REGISTER/LOGIN */ )
    {
        SendClientMessage (playerid, 0xFF0000FF, "You need to register/login first." );
        return 0; // Returning 0 will prevent the player from spawning
    }
    return 1;
}
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
pawn Код:
public OnPlayerRequestClass( playerid, classid )
{
    if( /* CHECK IF THEY DID NOT REGISTER/LOGIN */ )
    {
        SendClientMessage (playerid, 0xFF0000FF, "You need to register/login first." );
        return 0; // Returning 0 will prevent the player from spawning
    }
    return 1;
}
Thank you very much, understood!
Reply
#4

That works, but TogglePlayerSpectating also definitely works to bypass the screen as a whole. Just add TogglePlayerSpectating under OnPlayerRequestClass (with the same if check to see if he's logged in etc).
Reply
#5

TogglePlayerSpectating will re-spawn the player and it will prevent the player class, but he asked something to prevent them from spawning before they register/login.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)