[HELP] Making A Menu To Pick A Class
#1

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

https://sampwiki.blast.hk/wiki/Creating_a_simple_Menu
Reply
#3

Alright
Reply
#4

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

Yes Please
Reply
#6

Alright, would you want this to show up on:

OnPlayerSpawn or a command?
Reply
#7

OnPlayerSpawn
Reply
#8

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

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

I understand a little bit can you explain more
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)