How to put a reason?
#1

Hello,

I've got a question. I want to know how to make a reason for kicking someone.
If I now kick someone it only says "Name has got kicked by Admin."
I want to make something but I don't know how so that's the reason why I make this topic.
How to make a reason.

"Name has got kicked by Admin Reason: Spamming"

EDIT: I forgot to post my kick script here it is. Someone please modify it or explain how to make it.
http://pastebin.com/m22c9389f
Reply
#2

Search for filterscripts? with a ban and kick function

Here is a example from ladmin

maybe this will help you...


Код:
dcmd_ban(playerid,params[]) {
	if(PlayerInfo[playerid][LoggedIn] == 1) {
		if(PlayerInfo[playerid][Level] >= 4) {
		  new tmp[256], tmp2[256], Index;		tmp = strtok(params,Index), tmp2 = strtok(params,Index);
		  if(!strlen(params)) return SendClientMessage(playerid, red, "USAGE: /ban [playerid] [reason]");
			if(!strlen(tmp2)) return SendClientMessage(playerid, red, "ERROR: You must give a reason");
	  	new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
			player1 = strval(tmp);

		 	if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && (PlayerInfo[player1][Level] != ServerInfo[MaxAdminLevel]) ) {
				GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
				new year,month,day,hour,minuite,second; getdate(year, month, day); gettime(hour,minuite,second);
				CMDMessageToAdmins(playerid,"BAN");
				format(string,sizeof(string),"%s has been banned by Administrator %s [Reason: %s] [Date: %d/%d/%d] [Time: %d:%d]",playername,adminname,params[2],day,month,year,hour,minuite);
				SendClientMessageToAll(grey,string);
				SaveToFile("BanLog",string);
				print(string);
				if(udb_Exists(PlayerName2(player1)) && PlayerInfo[player1][LoggedIn] == 1) dUserSetINT(PlayerName2(player1)).("banned",1);
				format(string,sizeof(string),"banned by Administrator %s. Reason: %s", adminname, params[2] );
				return BanEx(player1, string);
			} else return SendClientMessage(playerid, red, "Player is not connected or is yourself or is the highest level admin");
		} else return SendClientMessage(playerid,red,"ERROR: You are not a high enough level to use this command");
	} else return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
}
Reply
#3

I forgot to post my script.
Reply
#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
#5

Please don't just post a random script but try to help me modifieng it please.
Reply
#6

Do it yourself.
Reply
#7

Quote:
Originally Posted by Cr0ssFir3
Do it yourself.
Don't bump old topics..
Reply
#8

Is today "Old Is Gold Day" ? LOL
Reply
#9

Quote:
Originally Posted by ►►►Peter Corneile◄◄◄
Is today "Old Is Gold Day" ? LOL
wtf ¬¬
Reply
#10

Lol cos he chose such an old post to answer
Reply


Forum Jump:


Users browsing this thread: