Hello everyone , How to add in a script , When a Player request class , he will have to choose the Place where he will spawn , then he will choose the team. Example : The Player connected to the server and He will choose between Airport , Unity station and The Docks to spawn , then He'll choose a skin.
Help me please , tell me how or put a Tutorial link.
pawn Код:
#define SPAWN_DIALOG 1
public OnPlayerSpawn(playerid)
{
ShowPlayerDialog(playerid, SPAWN_DIALOG, DIALOG_STYLE_LIST, "Choose where you want to spawn","Las Venturas Airpost \nUnity station \nThe Docks","Select","Cancel");
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == SPAWN_DIALOG)
{
switch(listitem)
{
case 0: //Las venturas Airport
{
SetPlayerPos(playerid, X, Y, Z); //X, Y, Z Coordiantes to the airport
ChooseSkin(playerid);
return 1;
}
case 1: //Unity Station
{
SetPlayerPos(playerid, X, Y, Z); //X, Y, Z Coordiantes to the unity station
ChooseSkin(playerid);
return 1;
}
case 2: //The Docks
{
SetPlayerPos(playerid, X, Y, Z); //X, Y, Z Coordiantes to the docks
ChooseSkin(playerid);
return 1;
}
}
}
else if(dialogid == SPAWN_DIALOG+1)
{
switch(listitem)
{
case 0: //Skin 1
{
SetPlayerSkin(playerid, 1);
return 1;
}
case 1: //Skin 2
{
SetPlayerSkin(playerid, 2);
return 1;
}
case 2: //Skin 3
{
SetPlayerSkin(playerid, 3);
return 1;
}
}
}
return 1;
}
stock ChooseSkin(playerid)
{
ShowPlayerDialog(playerid, SPAWN_DIALOG+1, DIALOG_STYLE_LIST, "Choose your skin","Skin 1 \nSkin 2 \nSkin 3","Select","Cancel");
return 1;
}