remove 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: remove spawn button (
/showthread.php?tid=465003)
remove spawn button -
Iron3man - 20.09.2013
One simple question, how i can remove the spawn button from teamselection?
Re: remove spawn button - Patrick - 20.09.2013
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
Re: remove spawn button -
Iron3man - 20.09.2013
what happen if a player want's to change team?
Re: remove spawn button -
JimmyCh - 20.09.2013
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..
Re: remove spawn button -
Iron3man - 21.09.2013
Thanks man it work's for me
+rep
Re: remove spawn button - Patrick - 21.09.2013
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;
}