SA-MP Forums Archive
Display message before 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: Display message before being kicked (/showthread.php?tid=497785)



Display message before being kicked - Vasu99 - 28.02.2014

I'd love it if you guys could help me out with how to display a message to a player shortly before he is kicked from the server. I've made a kick command, but I realized it kicks the player before he gets the message that he's supposed to get.

Код:
CMD:kick(playerid,params[])
{
    if(PlayerInfo[playerid][Level] < 1) return SendClientMessage(playerid,0xF69521AA, "You can't use this command!");//Checking if the player has admin level 1, if not it sends him a message.
    new id;//Creating a variable to store the selected id;
    if(sscanf(params,"u",id)) return SendClientMessage(playerid,0xF69521AA,"USAGE: /kick <id>");//Checking if the player has selected an id, other wise it sends him a message. We used the "u" specifier, because he can put a name or an id.
    if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xF69521AA,"That player is not connected!");//Checking if the selected user is connected or not.
    SendClientMessage(playerid,0xF69521AA,"You have successfully kicked the selected user from La Ville De L'Isle Roleplay!");
	Kick(id);
    return 1;
}
Cheers!


Re: Display message before being kicked - doreto - 28.02.2014

https://sampwiki.blast.hk/wiki/Kick


Re: Display message before being kicked - Vasu99 - 28.02.2014

Actually, sorry for being such a retard, haha, but that wasn't really the problem. The problem is that the admin doesn't receive the "You have successfully kicked the selected user from La Ville De L'Isle Roleplay" message when he kicks a player. I've got no idea what I meant in the actual post, I'm sorry.

P.S: Thank you Doreto, though, for giving me that link. I bet it'll come handy when I make some other admin commands.


Re: Display message before being kicked - Vasu99 - 28.02.2014

Anyone? How can I make the admin that kicked the player receive the "You have successfully kicked the selected user from La Ville De L'Isle Roleplay" message? I don't quite see the problem in my script.