/ban : You are not an admin
#10

No I have a normal ban command, just as the one off the GF, I edited it, so that if a lower ranked admin kicks a higher ranked admin, it auto kicks em, and if a lower ranked admin trys to ban a higher ranked admin, it autobans them, and before I even put that system in, it was giving me that problem, here's the system without my addin.

Код:
	if(strcmp(cmd, "/ban", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
	    	tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /ban [playerid/PartOfName] [reason]");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 2)
			{
			    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[264];
						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: /ban [playerid/PartOfName] [reason]");
							return 1;
						}
						new year, month,day;
						getdate(year, month, day);
						format(string, sizeof(string), "Notice: %s was banned by %s, reason: %s (%d-%d-%d)", giveplayer, sendername, (result),month,day,year);
						BanLog(string);
						format(string, sizeof(string), "Notice: %s was banned by an admin, reason: %s", giveplayer, (result));
						SendClientMessageToAll(COLOR_LIGHTRED, string);
						format(string, sizeof(string), "Notice: %s was banned by %s", giveplayer, sendername);
						ABroadCast(COLOR_YELLOW,string,1);
						PlayerInfo[giveplayerid][pBanned] = 1;
						Ban(giveplayerid);
						return 1;
					}
				}//not connected
			}
			else
			{
				format(string, sizeof(string), "   %d is not an active player.", giveplayerid);
				SendClientMessage(playerid, COLOR_GRAD1, string);
			}
		}
		return 1;
	}
Reply


Messages In This Thread
/ban : You are not an admin - by Lars_Frederiksen - 26.10.2010, 02:17
AW: /ban : You are not an admin - by Extremo - 26.10.2010, 02:18
Re: /ban : You are not an admin - by Scenario - 26.10.2010, 02:19
Re: /ban : You are not an admin - by Haydz - 26.10.2010, 02:34
Re: /ban : You are not an admin - by Lars_Frederiksen - 26.10.2010, 02:45
Re: /ban : You are not an admin - by Scenario - 26.10.2010, 02:47
Re: /ban : You are not an admin - by Lars_Frederiksen - 26.10.2010, 03:02
Re: /ban : You are not an admin - by Scenario - 26.10.2010, 03:07
Re: /ban : You are not an admin - by Kitten - 26.10.2010, 03:16
Re: /ban : You are not an admin - by Lars_Frederiksen - 26.10.2010, 03:21

Forum Jump:


Users browsing this thread: 1 Guest(s)