#1

Help me in kick command there is a message but he/she didnt kicked in server
Sorry for my english
Reply
#2

Show us your code?
Reply
#3

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Show us your code?
Код:
if(strcmp(cmd, "/kick", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid/PartOfName] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if(IsPlayerNPC(giveplayerid)) return 1;
			if(PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 4)
			{
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
					    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						new length = strlen(cmdtext);
						while ((idx < length) && (cmdtext[idx] <= ' '))
						{
							idx++;
						}
						new offset = idx;
						new result[96];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid/PartOfName] [reason]");
							return 1;
						}
						new logstring[256];
						new year, month, day;
						getdate(year, month, day);
						if(PlayerInfo[giveplayerid][pAdmin] > PlayerInfo[playerid][pAdmin])
						{
						    format(logstring, sizeof(logstring), "{AA3333}AdmCmd{FFFF00}: %s was kicked, reason: Attempting to kick admin %s (%d-%d-%d).", sendername, giveplayer,month,day,year);
						    KickLog(logstring);
						    format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was kicked, reason: Attempting to kick a higher admin.", sendername);
							SendClientMessageToAll(COLOR_LIGHTRED, string);
							SetTimerEx("GettingKicked", 2000, false, "i", giveplayer);
							return 1;
						}
						format(logstring, sizeof(logstring), "{AA3333}AdmCmd{FFFF00}: %s was kicked by %s, reason: %s (%d-%d-%d).", giveplayer, sendername, (result),month,day,year);
						KickLog(logstring);
						format(string, sizeof(string), "{AA3333}AdmCmd{FFFF00}: %s was kicked by %s, reason: %s", giveplayer, sendername, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						SetTimerEx("GettingKicked", 2000, false, "i", giveplayer);
						return 1;
					}
Reply
#4

Show us your "GettingKicked" callback.
Reply
#5

Код:
public GettingKicked(playerid)
{
	Kick(playerid);
}
this one
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)