SA-MP Forums Archive
Show a dialog after being kicked - 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: Show a dialog after being kicked (/showthread.php?tid=399159)



Show a dialog after being kicked - Josh_Main - 13.12.2012

I've seen it in other servers, is there any script that I can add to a filterscript so that when I /kick someone it shows a dialog on there screen saying "You have been kicked by "blah blah" Reason: blah. If it's possible, could someone please create me a small script to add on the end to make it do that, or please give me an idea. Thanks in advanced!


Re: Show a dialog after being kicked - Threshold - 13.12.2012

This is simple, you just need to use the ShowPlayerDialog BEFORE you actually 'kick' the player.
Example:
pawn Код:
ShowPlayerDialog(targetid, DIALOG_KICK, ...
Kick(targetid);
The above code would work, HOWEVER:
pawn Код:
Kick(targetid);
ShowPlayerDialog(targetid, DIALOG_KICK, ...
might not work... so just give that a shot.


Re: Show a dialog after being kicked - RajatPawar - 13.12.2012

In your 'kick' command, just use format to get the reason string and the admin who kicked him and send it through ShowPlayerDialog.. Something like, example:
pawn Код:
new st[128];
format(st, sizeof(st), "You have been kicked from the server by %s for, REASON: %s", GetName(targetid), GetName(playerid));
//assuming targetid is the player who is getting kicked, and playerid the one executing it, and GetName is the function to get a player's name!



Re: Show a dialog after being kicked - Josh_Main - 13.12.2012

Thank you so much!