SA-MP Forums Archive
Question about dialogs - 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: Question about dialogs (/showthread.php?tid=253499)



Question about dialogs - Jack_Rocker - 06.05.2011

Basically I want it to be so when I type in /kick, a (input)dialog pops up where you can type in the id of the person yo want to kick. I know its a bit confusing, but whoeever does it gets a virtual cookie :')


Re: Question about dialogs - Calgon - 06.05.2011

It's rather quite easy, I'll create an example of how to do this for you.

Add this to your /kick command:
pawn Код:
ShowPlayerDialog(playerid, 666,DIALOG_STYLE_INPUT,"Kick","Enter the ID of the person you want to kick","Kick","Cancel");
and then inside OnDialogResponse, add this:

pawn Код:
if(dialogid == 666) {

    if(!response) return 1;

    new
        iReturn = strval(inputtext);

    if(IsPlayerConnected(iReturn)) {
        Kick(iReturn);
    }
}



Re: Question about dialogs - Jack_Rocker - 06.05.2011

thanks You ge a virtuak cikie