18.04.2015, 04:23
Do you want to disable player class selection?
If yes, use this include: http://forum.sa-mp.com/showthread.ph...35#post3434035
Read there(in NOTES section) how to disable class selection.
If you want the player to go to a spectate screen, Read the callback OnPlayerEnterClassSelection(in NOTES section).
Here is an example:
Read the comments in the script^; What this do is, when a player enters Class selection, he is directed to a spectate screen and is shown a dialog to choose genre.
Configure the dialog and its response in callback: OnDialogResponse yourself. If you want the player to come back from spectate screen, use TogglePlayerSpectating(playerid, false);
If yes, use this include: http://forum.sa-mp.com/showthread.ph...35#post3434035
Read there(in NOTES section) how to disable class selection.
If you want the player to go to a spectate screen, Read the callback OnPlayerEnterClassSelection(in NOTES section).
Here is an example:
pawn Code:
#include <a_samp>
#include <classcontrol>
public OnPlayerEnterClassSelection(playerid)
{
//Now show your dialogs here:
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_LIST, "Select Genre", "your list", "Select", "");
return 0;//returning 0, the player will go to spectate screen
}
public OnPlayerExitClassSelection(playerid)
{
return 1;
}
public OnPlayerSwitchClass(playerid, classid, bool:next)
{
return 1;
}
public OnPlayerSpawnClass(playerid, classid)
{
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == 0)
{
if(response)
{
switch(listitem)
{
case 0:
{
//your code, the player selected the 1st listitem
}//and so one...
}
}
}
return 1;
}
Configure the dialog and its response in callback: OnDialogResponse yourself. If you want the player to come back from spectate screen, use TogglePlayerSpectating(playerid, false);