SA-MP Forums Archive
Calling DCMD commands from under OnDialogResponse? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Calling DCMD commands from under OnDialogResponse? (/showthread.php?tid=266420)



Calling DCMD commands from under OnDialogResponse? - XpanD - 04.07.2011

Hi all,

I am a bit lost here. I am trying to make a huge teleport dialog which contains all the teleports on my server spread out over several categories. My original plan was to call the commands directly from under the dialog - like so:
pawn Код:
dcmd_example(playerid, params);
As was to be expected, I get an error about lacking params. However, I cannot for the life of me figure out how to define these params as unused. I know that within a command I can simply use...
pawn Код:
#pragma unused params
...but that does not work here.

How do I call a DCMD command directly from within OnDialogResponse?

Thanks in advance.


Re: Calling DCMD commands from under OnDialogResponse? - Vince - 04.07.2011

Depends. If you don't want to send any params, then just put "" (two double quotes) in there and it'll work. If you DO want to send params, you'll have to format them all in the right order in a string and then send that string to the function.


Re: Calling DCMD commands from under OnDialogResponse? - XpanD - 04.07.2011

Hmm... Just tried that, script compiled fine, but the dialog option does not do anything at all. I think it might be my dialog, so I'm gonna try something here. I'll edit my post with the results.

EDIT: It works! My dialog was broken. Fixed that, applied your method, and it works great. Thanks!


Re: Calling DCMD commands from under OnDialogResponse? - FireCat - 04.07.2011

I normally do
pawn Код:
dcmd_example(playerid, inputtext);
or
pawn Код:
dcmd_example(playerid,"params");
All result in the same because they are arrays.