SA-MP Forums Archive
Disable SPAWN - 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)
+--- Thread: Disable SPAWN (/showthread.php?tid=369165)



Disable SPAWN - Healian - 16.08.2012

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


Re: Disable SPAWN - Kindred - 16.08.2012

Use TogglePlayerSpectating

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


Re: Disable SPAWN - tyler12 - 16.08.2012

TogglePlayerSpectating(playerid,true);

set a timer

togleplayerspectating(playerid,false);


Re: Disable SPAWN - Healian - 16.08.2012

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


Re: Disable SPAWN - Healian - 16.08.2012

guys where you gone


Re: Disable SPAWN - Kindred - 16.08.2012

Don't bump.

Then after they login, just TogglePlayerSpectate it off.

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


Re: Disable SPAWN - Healian - 16.08.2012

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


Re: Disable SPAWN - Healian - 16.08.2012

SO can i bump now


Re: Disable SPAWN - _Vortex - 16.08.2012

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.


Re: Disable SPAWN - SEnergy - 16.08.2012

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