Removing the class selection buttons
#1

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

put it under OnPlayerSpawn or OnPlayerConnect i think that will solve it
Reply
#3

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

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

Also, with TogglePlayerSpecate the buttons will be removed
Reply
#6

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

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

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

You can make a textdraw above it.
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)