SA-MP Forums Archive
disable spawn button - 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 button (/showthread.php?tid=541781)



disable spawn button - kbalor - 14.10.2014

Hi. Can someone please help me disable the spawn button before choosing a player(OnPlayerRequestClass)?

EDIT: I only want to show the spawn button right exactly when choosing skin/player comes, not before when game still loading.


Re: disable spawn button - Rudy_ - 14.10.2014

pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, true);
    return 1;
}



Re: disable spawn button - kbalor - 14.10.2014

Help after putting it on

Code:
public OnPlayerConnect(playerid)
{
    TogglePlayerSpectating(playerid, 1);
    return 1;
}
then disabling it on
Code:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, 0);
    return 1;
}
now I don't seen any of my skins on OnplayerRequestClass. theres something wrong?


Re: disable spawn button - AnnaSB - 14.10.2014

That solution completely skips the Class Selection.
You want to disable the Spawn button, or better to say take control of it...
Actually it's currently impossible in SAMP, we hope they give us more control on Class Selection and before it, like Camera routing before Class Selection in later versions.


Re: disable spawn button - Blunt - 14.10.2014

You could create your own class selection, obviously after you TogglePlayerSpectating(playerid,true);, if you don't include that before your class selection the 'Spawn' button will still be visible.


Re: disable spawn button - kbalor - 14.10.2014

thanks guys. what my other option is to make a small box textdraw that will hide the spawn button and make a timer then destroy the textdraw onplayerrequestclass.


Re: disable spawn button - AnnaSB - 15.10.2014

Quote:
Originally Posted by kbalor
View Post
thanks guys. what my other option is to make a small box textdraw that will hide the spawn button and make a timer then destroy the textdraw onplayerrequestclass.
You cannot, spawn buttons are TOPMOST.
You can skip class selection and make a custom class selection using textdraws...


Re: disable spawn button - Anzipane - 15.10.2014

The best way to achieve a custom class selection is setting the player in spectating mode when he comes to the class selection:
pawn Code:
public OnPlayerRequestClass(playerid, classid)
{
    TogglePlayerSpectating(playerid, 1);

    // Make your own class selection...

    TogglePlayerSpectating(playerid, 0);
    SpawnPlayer(playerid);
    return 1;
}



Re: disable spawn button - VishvaJeet - 15.10.2014

public OnPlayerRequestClass(playerid, classic){
// code
return 0;
}


Re: disable spawn button - Juvanii - 15.10.2014

What's the point of this?