remove spawn button
#1

One simple question, how i can remove the spawn button from teamselection?
Reply
#2

To be able to skip OnPlayerRequestClass callback, you must have a Timer, SetSpawnInfo, TogglePlayerSpectating. SpawnPlayer and last but not least a call back.

Example
pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    SetSpawnInfo(playerid, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0);
    TogglePlayerSpectating(playerid, 1);
    SpawnPlayer(playerid);
    SetTimerEx("SkipOnPlayerRequestClass", 100, false, "i", playerid);
    return 1;
}

//Place it anywhere
forward SkipOnPlayerRequestClass(playerid);
public SkipOnPlayerRequestClass(playerid)
{
    SpawnPlayer(playerid);
    TogglePlayerSpectating(playerid, 0);
    return 1;
}
PS: Enjoy!, hope this code works
Reply
#3

what happen if a player want's to change team?
Reply
#4

If you mean like remove it if you have some tutorial or something, you use "TogglePlayerSpectating(playerid, 1);"
This removes the Spawn Button but I don't know about your use of it..
Reply
#5

Thanks man it work's for me
+rep
Reply
#6

Alright, since I gave you a Correct code (I guess), Just make a dialog which sets the player team with the variable and the team colour. and just do place the ShowPlayerDialog on SkipOnPlayerRequestClass


Example
pawn Код:
forward SkipOnPlayerRequestClass(playerid);
public SkipOnPlayerRequestClass(playerid)
{
    SpawnPlayer(playerid);
    TogglePlayerSpectating(playerid, 0);
    ShowPlayerDialog(playerid, DIALOG_ID, DIALOG_STYLE_LIST, "Choose Your Team", "Terrorist\n Etc...", "Choose", "");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)