OnPlayerDissconect message - 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: OnPlayerDissconect message (
/showthread.php?tid=322817)
OnPlayerDissconect message -
Bogdan1992 - 03.03.2012
Hi, well i the problem is, i have a ban checker and everytime when someone joins and his banned it shows me the left message.
I have this on playerconnect.
PHP код:
new query[300], ip[16];
GetPlayerName(playerid, pname, sizeof pname);
GetPlayerIp(playerid, ip, 16);
format(query, sizeof(query), "SELECT * FROM `Banned` WHERE `User` LIKE '%s' OR `IP` LIKE '%s' LIMIT 1", pname, ip);
mysql_query(query);
mysql_store_result();
if(mysql_num_rows() >= 1)
{
SendClientMessage(playerid, COLOR_SILVER, "You are banned from this server");
TogglePlayerControllable(playerid, 0);
loginbanned[playerid] = 1;
Kick(playerid);
}
mysql_free_result();
loginbanned[playerid] = 0;
This on Onplayerdissconect
PHP код:
if(loginbanned[playerid] == 0)
{
switch(reason)
{
case 0: format(mystring, sizeof(mystring), "%s has left the server. (Lost Connection)", pname);
case 1: format(mystring, sizeof(mystring), "%s has left the server.", pname);
case 2: format(mystring, sizeof(mystring), "%s has left the server.", pname);
}
And another problem is, the banned person sees the server restarting.
How can i fix these?
Re: OnPlayerDissconect message -
Konstantinos - 03.03.2012
It's a bug on 0.3d
OnPlayerConnect Callback makes the player to reconnect.
Re: OnPlayerDissconect message -
Bogdan1992 - 03.03.2012
any chances to evade that message from case 2.
EDIT: I remember i fixed that but it stop sending that message but it keeps sending random messages from script
Re: OnPlayerDissconect message -
Bogdan1992 - 04.03.2012
So how can i get rid of that case 2. It pisses me of , I removed the case 2 but when someone gets kicked(for wrongpass or kicked by an admin) it inserts a msg(empy msg).