disable spawn button
#1

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.
Reply
#2

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

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?
Reply
#4

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.
Reply
#5

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.
Reply
#6

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.
Reply
#7

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...
Reply
#8

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;
}
Reply
#9

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

What's the point of this?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)