SA-MP Forums Archive
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(stringsizeof(string), "Admin %s[%i] just has banned player %s[%i]. [Reason: %s]"PlayerName(playerid), playeridPlayerName(id), idparam2);
SendClientMessageToAll(0xFF0000FFstring); // I will send a message to all at first
BanEx(idparam2); // 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