A message in chat before kick/ban - 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: A message in chat before kick/ban (
/showthread.php?tid=650737)
A message in chat before kick/ban -
ForestCZE - 05.03.2018
Hello everyone
I've got this code:
PHP код:
new string[128];
format(string, sizeof(string), "Admin %s[%i] just has banned player %s[%i]. [Reason: %s]", PlayerName(playerid), playerid, PlayerName(id), id, param2);
SendClientMessageToAll(0xFF0000FF, string); // I will send a message to all at first
BanEx(id, param2); // I will ban the player
The problem is - All players can see the message in chat
except of the banned player.
The same situation will happen with
Kick function. Why? Thanks in advance for a help
Re: A message in chat before kick/ban -
MrThomas - 05.03.2018
You need to use a timer. Try googling on how to use it.
Re: A message in chat before kick/ban -
ForestCZE - 05.03.2018
Quote:
Originally Posted by MrThomas
You need to use a timer. Try googling on how to use it.
|
Yes, I know how to use a timer, but it's a strange solution.
Is it not there any better solution, how to fix that?
Re: A message in chat before kick/ban -
Sew_Sumi - 05.03.2018
Quote:
Originally Posted by ForestCZE
Yes, I know how to use a timer, but it's a strange solution. 
|
This has been the way it has been done for at least a year or 2 now.
It's also posted about a lot, and if you'd searched, you'd have found it.
Re: A message in chat before kick/ban -
PrawkC - 09.03.2018
You can use a unix timestamp inside OnPlayerUpdate.
IE...
https://pastebin.com/ememx0VR