How to put a reason?
#4

try this one

Код:
if(strcmp(cmd, "/kick", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
	  	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[play
erid][pAdmin] >= 1)
			{
				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[64];
						while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
						{
							result[idx - offset] = cmdtext[idx];
							idx++;
						}
						result[idx - offset] = EOS;
						if(!strlen(result))
						{
							SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /kick [playerid/PartOfName] [reason]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s %d/%d/%d", giveplayer, sendername, (result),day,month,year);
						getdate(year, month, day);
						format(string, sizeof(string), "AdmCmd: %s was kicked by %s, reason: %s %d/%d/%d", giveplayer, sendername, (result),day,month,year);
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						KickLog(string);
						Kick(giveplayerid);
						return 1;
					}
				}
			}
			else
			{
				format(string, sizeof(string), "  %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
Reply


Messages In This Thread
How to put a reason? - by joeri55 - 19.06.2009, 16:55
Re: How to put a reason? - by smokey104 - 19.06.2009, 17:03
Re: How to put a reason? - by joeri55 - 19.06.2009, 17:18
Re: How to put a reason? - by smokey104 - 19.06.2009, 17:28
Re: How to put a reason? - by joeri55 - 19.06.2009, 22:55
Re: How to put a reason? - by Cr0ssFir3 - 22.09.2009, 19:44
Re: How to put a reason? - by Correlli - 22.09.2009, 19:46
Re: How to put a reason? - by Peter_Corneile - 22.09.2009, 19:52
Re: How to put a reason? - by [XST]O_x - 22.09.2009, 19:59
Re: How to put a reason? - by Peter_Corneile - 22.09.2009, 21:04

Forum Jump:


Users browsing this thread: 2 Guest(s)