Commands menu
#1

Hi everyone, i'd like to know if someone know how to do an in-game menu in a samp server with all the server's command because i searched in many websites or forums but i didn't find anything about it. I want to tell you guys that I'm sorry to ask you this and that I ask it because also im not really good at sctipting . So if you know how to do want the menu can your send me a copy of it please ?

Thank you for your help guys
Reply
#2

ShowPlayerDialog

or

SendClientMessage.

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

ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[])

So, you could:

pawn Код:
// in OnPlayerCommandText  (if you're using that??)
if(strcmp("/commands", cmdtext, true, 8) == 0)
{
    // using 1 for dialogid might cause conflict, change it to the next available id.
    ShowPlayerDialog(playerid, /* dialogid */ 1, DIALOG_STYLE_LIST, "Commands Menu", "Player Commands\nAdmin Commands", "Select", "Cancel");
    return 1;
}

// if using ZCMD

CMD:commands(playerid, params[])
{
    // using 1 for dialogid might cause conflict, change it to the next available id.
    ShowPlayerDialog(playerid, /* dialogid */ 1, DIALOG_STYLE_LIST, "Commands Menu", "Player Commands\nAdmin Commands", "Select", "Cancel");
    return 1;
}

// In OnDialogResponse

if(dialogid == 1 /* or the dialogid you selected */)
{
    if(response) {
        switch(listitem) {
            case 0: {
                SendClientMessage(playerid, -1, "*Commands* Some commands here");
            }
            case 1: {
                if(IsPlayerAdmin(playerid)) {
                    SendClientMessage(playerid, -1, "*Admin Commands* some commands here");
                }
            }
        }
    }  
}
Reply
#4

thanks a lot guys but do i have to put my commands like this "/commands" or just like this "commands" ?
Reply
#5

%SHOW_ADVANCE_DIALOG_PLAYER%
THEN START SCRIPTING AND IT SHOULD WORK
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)