Disable SPAWN
#1

i want to disable or hide the SPAWN button so the player is able to show\click it only after he login\register to the server



I tried
pawn Код:
TogglePlayerSpectating(playerid, 1);
but when i do this
pawn Код:
TogglePlayerSpectating(playerid, 0);
The player dc from the server cuz there is no spawned player

Conclusion of my question : i want to hide the spawning buttons for a while the show it again on a command
Reply
#2

Use TogglePlayerSpectating

Just make sure you disable it right before you spawn to prevent shit.
Reply
#3

TogglePlayerSpectating(playerid,true);

set a timer

togleplayerspectating(playerid,false);
Reply
#4

it does not work for me cuz i want to turn Spectating off before the player spawn

i want to hide the buttons during the login period then show them again so the player can select the char and spawn
Reply
#5

guys where you gone
Reply
#6

Don't bump.

Then after they login, just TogglePlayerSpectate it off.

If that doesn't work, you're probably doing it wrong.
Reply
#7

No man you dont understand me what i am doing is as following

OnPlayerRequestClass i do some camera moving while which the player Registers or logins - this is what i want to hide the spawn while -

Then when he register or login successfully i want the spawn buttons to appear again so the player can select the player he wants and spawn

So i want the SPAWN to be temporarily hidden until the player registers then it must be showed again so the player can spawn
Reply
#8

SO can i bump now
Reply
#9

For future notice, people aren't going to be interested in helping you if you keep bumping your threads.

As for your problem, it's been answered like 3 times.Once they connect turn TogglePlayerSpectate on. Once they register or login set TogglePlayerSpectate to off. Then it should allow them to spawn.
Reply
#10

pawn Код:
public OnPlayerConnect(playerid)
{
    TogglePlayerSpectating(playerid, true);
    ShowPlayerDialog(playerid, iLoginDialog, DIALOG_STYLE_PASSWORD, "Login", string[playerid], "Login", "Quit");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == iLoginDialog)
    {
        if(response)
        {
            TogglePlayerSpectating(playerid, false);
            return 1;
        }
        else
            ShowPlayerDialog(playerid, iLoginDialog, DIALOG_STYLE_PASSWORD, "Login", string[playerid], "Login", "Cancel");
    }
    return 1;
}
easy as that
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)