SA-MP Forums Archive
Help me ! - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help me ! (/showthread.php?tid=232026)



Help me ! - Soumi - 26.02.2011

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.

Thanks

Soumi


Re : Help me ! - Soumi - 26.02.2011

Anyone can help me?


Re: Help me ! - Unknown123 - 26.02.2011

This Should Work (Not Tested)

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;
}
Maybe Helps:
ShowPlayerDialog
OnDialogResponse
SetPlayerPos
SetPlayerSkin