SA-MP Forums Archive
Kicking System - 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: Kicking System (/showthread.php?tid=417879)



Kicking System - Nivniv2 - 22.02.2013

Код:
CMD:kick(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 2 || PlayerInfo[playerid][pDonateRank] == 6)
	{
		new string[128], giveplayerid, reason[64];
		if(sscanf(params, "us[64]", giveplayerid, reason)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /kick [playerid] [reason]");

		if(IsPlayerConnected(giveplayerid))
		{
				new year, month,day;
				getdate(year, month, day);
				new playerip[32];
				GetPlayerIp(giveplayerid, playerip, sizeof(playerip));
				format(string, sizeof(string), "AdmCmd: %s (IP:%s) was kicked by %s, reason: %s (%d-%d-%d)", GetPlayerNameEx(giveplayerid), playerip, GetPlayerNameEx(playerid), reason,month,day,year);
				Log("logs/kick.log", string);
				if(PlayerInfo[playerid][pAdmin] == 1) Log("logs/moderator.log", string);
				format(string, sizeof(string), "PlayerKick: %s was kicked by %s, reason: %s", GetPlayerNameEx(giveplayerid), GetPlayerNameEx(playerid), reason);
				SendClientMessageToAllEx(COLOR_LIGHTRED, string);
				Kick(giveplayerid);
			}
			return 1;
		}
	else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
	return 1;
}
When im kicking someone, its tells him "Server Closed Connection" expect for "AdmCmd: %s was kicked by %s, reason: %s" and then "Server Closed Connection"


Re: Kicking System - detter - 22.02.2013

That is something with 0.3x....

you can use this...

add this on top
Код:
forward TIMER_KickPublic(playerid);
public TIMER_KickPublic(playerid) { Kick(playerid); }
and with this func you kick player
Код:
KickFor(id, msg[]) // ID of kicked player ,custom msg...
{
   // Add here your msg...
   return SetTimerEx("TIMER_KickPublic", 1000, 0, "d", id);
}



Re: Kicking System - Skribblez - 23.02.2013

http://forum.sa-mp.com/showthread.ph...92#post2365192

From Kalcor himself, have fun.