Redirecting a dialog selection to a CMD
#1

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

Do you want to see the server commands in a dialog or?
A bit drunk so I dont really get that D:
Reply
#3

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

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);
Reply
#5

You can use the same function as you used in the command: SetPlayerHealth(playerid, 100);
Reply
#6

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


Forum Jump:


Users browsing this thread: 1 Guest(s)