SA-MP Forums Archive
Removing the class selection buttons - 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: Removing the class selection buttons (/showthread.php?tid=320065)



Removing the class selection buttons - mitchboy - 21.02.2012

Hi guys, i'm trying to replace the class selection with a dialog.
This is what i have
Код:
public OnPlayerRequestClass(playerid, classid)
{
	ShowPlayerDialog(playerid,CLASS,DIALOG_STYLE_LIST,"Classes","Trucker\nPilot\nTaxi Driver\nPolice\nRapist","Select","Exit");
	return 1;
}
It shows the dialog, but i still get the « » Spawn Buttons, how can i remove these?
Thnx


Re: Removing the class selection buttons - niels44 - 21.02.2012

put it under OnPlayerSpawn or OnPlayerConnect i think that will solve it


Re: Removing the class selection buttons - mitchboy - 21.02.2012

i don't think so, the spawn buttons are standard so they won't go away with that i think


Re: Removing the class selection buttons - DrakeX - 21.02.2012

The user is going to need to be spawned. If you want to have the same camera angles, take the positions from OnPlayerRequestClass, spawn the user with SetSpawnInfoSetSpawnInfo and SpawnPlayer, then show the dialog while the user is viewing the camera.


Re: Removing the class selection buttons - milanosie - 21.02.2012

Also, with TogglePlayerSpecate the buttons will be removed


Re: Removing the class selection buttons - mitchboy - 21.02.2012

yeah i saw that on other problems too, the TogglePlayerSpectate part, thnx.


Re: Removing the class selection buttons - Maxymex - 17.06.2014

How to remove the "Spawn" button:

Код:
new bool:allowspawn[MAX_PLAYERS];
Код:
public OnPlayerConnect(playerid)
{
	allowspawn[playerid] = false;
}
After the player has logged in:
Код:
allowspawn[playerid] = true;
Код:
public OnPlayerRequestSpawn(playerid)
{
	if(allowspawn[playerid] == false)
	return 0;
}
And nothing happens when the player press the "Spawn" button!

Now how to remove the "<<" and ">>" buttons:

Add 2 player classes:
Код:
public OnGameModeInit()
{
	AddPlayerClass(0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
	AddPlayerClass(0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
}
Код:
public OnPlayerRequestClass(playerid, classid)
{
	if(classid == 1) return 0;
}



Re: Removing the class selection buttons - Rittik - 17.06.2014

Try this.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
   
    return 0; //Do "return 0;" here
}
Then, just show the dialog to the player when they connect.
pawn Код:
OnPlayerConnect(playerid)
{
  ShowPlayerDialog(playerid,CLASS,DIALOG_STYLE_LIST,"Classes","Trucker\nPilot\nTaxi Driver\nPolice\nRapist","Select","Exit");
  return 1;
}



Re: Removing the class selection buttons - Mey6155 - 17.06.2014

You can make a textdraw above it.


Re: Removing the class selection buttons - Maxymex - 17.06.2014

Quote:
Originally Posted by Rittik
Посмотреть сообщение
Try this.

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
   
    return 0; //Do "return 0;" here
}
Then, just show the dialog to the player when they connect.
pawn Код:
OnPlayerConnect(playerid)
{
  ShowPlayerDialog(playerid,CLASS,DIALOG_STYLE_LIST,"Classes","Trucker\nPilot\nTaxi Driver\nPolice\nRapist","Select","Exit");
  return 1;
}
That doesn't work.