Commands menu - 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: Commands menu (
/showthread.php?tid=497654)
Commands menu -
brandypol - 28.02.2014
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
Re: Commands menu -
UnknownOwner - 28.02.2014
ShowPlayerDialog
or
SendClientMessage.
https://sampwiki.blast.hk/
Re: Commands menu -
Scaleta - 28.02.2014
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");
}
}
}
}
}
Re: Commands menu -
brandypol - 28.02.2014
thanks a lot guys
but do i have to put my commands like this "/commands" or just like this "commands" ?
Re: Commands menu -
okiknow - 09.08.2018
%SHOW_ADVANCE_DIALOG_PLAYER%
THEN START SCRIPTING AND IT SHOULD WORK