SA-MP Forums Archive
[HELP] Making A Menu To Pick A Class - 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: [HELP] Making A Menu To Pick A Class (/showthread.php?tid=390520)



[HELP] Making A Menu To Pick A Class - AchievementMaster360 - 06.11.2012

I want to make a a menu to make a class like the picture in the link below i only want 4 classes but with out the part that you need a certain rank to pick a class i'm not sure how to make it and when you click it, it gives you the class

http://tinypic.com/r/27wsx3k/6

Thanks


Re: [HELP] Making A Menu To Pick A Class - Glad2BeHere - 06.11.2012

https://sampwiki.blast.hk/wiki/Creating_a_simple_Menu


Re: [HELP] Making A Menu To Pick A Class - AchievementMaster360 - 06.11.2012

Alright


Re: [HELP] Making A Menu To Pick A Class - Abreezy - 06.11.2012

Do you still need help with this? Also the image provided by yourself, is a Dialog, let me know if you would like to see an example of how to make this.


Re: [HELP] Making A Menu To Pick A Class - AchievementMaster360 - 06.11.2012

Yes Please


Re: [HELP] Making A Menu To Pick A Class - Abreezy - 06.11.2012

Alright, would you want this to show up on:

OnPlayerSpawn or a command?


Re: [HELP] Making A Menu To Pick A Class - AchievementMaster360 - 06.11.2012

OnPlayerSpawn


Re: [HELP] Making A Menu To Pick A Class - Abreezy - 06.11.2012

Alright, this is just an example of how to do it, you will have to edit it to your classes, and ranks, for now, I will use player score.

pawn Код:
#define DIALOG_CLASSES      1000

new class[MAX_PLAYERS];

public OnPlayerSpawn(playerid)
{
    ShowPlayerDialog(playerid, DIALOG_CLASSES, DIALOG_STYLE_LIST, "Pick a Class", "Sniper \nArmy(10 score+) \nNavy(20 Score+) \nMarines(50 score+)", "Select","");
   
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_CLASSES:
        {
            new score = GetPlayerScore(playerid);
            if(!response){ }
            if(response)
            {
                switch(listitem)
                {
                    case 0:
                    {
                        if(score >= 0)
                        {
                            class[playerid] = 1;
                            SendClientMessage(playerid, -1, "You have joined the Sniper class!");
                        }
                    }
                    case 1:
                    {
                        if(score >= 10)
                        {
                            class[playerid] = 2;
                            SendClientMessage(playerid, -1, "You have joined the Army Class!");
                        }
                        else
                        {
                            SendClientMessage(playerid, -1, "You aren't high enough level for this.");
                            ShowPlayerDialog(playerid, DIALOG_CLASSES, DIALOG_STYLE_LIST, "Pick a Class", "Sniper \nArmy(10 score+) \nNavy(20 Score+) \nMarines(50 score+)", "Select","");

                        }
                    }
                    case 2:
                    {
                        if(score >= 20)
                        {
                            class[playerid] = 3;
                            SendClientMessage(playerid, -1, "You have joined the Navy Class!");
                        }
                        else
                        {
                            SendClientMessage(playerid, -1, "You aren't high enough level for this.");
                            ShowPlayerDialog(playerid, DIALOG_CLASSES, DIALOG_STYLE_LIST, "Pick a Class", "Sniper \nArmy(10 score+) \nNavy(20 Score+) \nMarines(50 score+)", "Select","");

                        }
                    }
                    case 3:
                    {
                        if(score >= 50)
                        {
                            class[playerid] = 4;
                            SendClientMessage(playerid, -1, "You have joined the Marines Class!");
                           
                        }
                        else
                        {
                            SendClientMessage(playerid, -1, "You aren't high enough level for this.");
                            ShowPlayerDialog(playerid, DIALOG_CLASSES, DIALOG_STYLE_LIST, "Pick a Class", "Sniper \nArmy(10 score+) \nNavy(20 Score+) \nMarines(50 score+)", "Select","");

                        }
                    }
                }
            }
           
        }
    }
    return 1;
}



Re: [HELP] Making A Menu To Pick A Class - Abreezy - 06.11.2012

That's just a very basic example, you could then use the class[playerid] to limit vehicle usage, and command usage. If you don't understand any of it, please say so and I'll try my best to explain.


Re: [HELP] Making A Menu To Pick A Class - AchievementMaster360 - 06.11.2012

I understand a little bit can you explain more