Redirecting a dialog selection to a CMD -
Andrew Missey - 01.04.2013
I am having a bunch of trouble with this one.
I am creating a dialog that will display all of the server commands, but I want to be able to click the command in the dialog_list and it executes that command. Is there anyway I can detour it or something back to the original command?
Example:
CMD:Health
{
SetPlayerHealth(playerid, 100);
}
-------------- Down to Dialog REsponse
if(listitem == 0) //the heal command in a dialog windo
{
//redirect or something to CMD:Health
return 1;
}
Hopefully you guys can understand what I am trying to do here.
Re: Redirecting a dialog selection to a CMD -
[..MonTaNa..] - 01.04.2013
Do you want to see the server commands in a dialog or?
A bit drunk so I dont really get that D:
Re: Redirecting a dialog selection to a CMD -
Andrew Missey - 01.04.2013
I have the actual command scripted above OnDialogResponse, but I want the player to be able to click the command in the dialog and have the same exact result as typing the command in.
Re: Redirecting a dialog selection to a CMD -
greentarch - 01.04.2013
If you use ZCMD
pawn Код:
if (listitem == 0) {
// Redirect them to CMD:health
cmd_health(playerid, "hello"); // this will send "/health hello", don't worry, it'll work
return true;
}
Use
[pawn] and [/pawn] tags next time.
Another example, this will redirect /me command with the params as inputtext
pawn Код:
if (response) return cmd_me(playerid, inputtext);
Re: Redirecting a dialog selection to a CMD -
ZackBoolaro - 01.04.2013
You can use the same function as you used in the command: SetPlayerHealth(playerid, 100);
Re: Redirecting a dialog selection to a CMD -
Andrew Missey - 01.04.2013
You rock greentarch!
Thanks!
Edit: I know Zach, but I have tons of commands, that was just an example. Putting all of the functions in again would be too time consuming and would make the script ridiculously long.