Help with Admin Cmds
#13

I think its good.

Here:
Код:
	if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
	{
		new reason[128];
		if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
		{
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, GREY, "USAGE: /freeze [playername/id] [reason]");
				SendClientMessage(playerid, GREY, "FUNCTION: Will freeze the specified player.");
				return 1;
			}

			new giveplayerid = ReturnUser(tmp);
			if(giveplayerid != INVALID_PLAYER_ID)
					  if (AccountInfo[giverplayerid][AdminLevel] >= AccountInfo[playerid][AdminLevel])
		  {
		    SendClientMessage(playerid, GREY, "You cannot nuke admins higher or equal to you");
		    return 1;
		  }
			{
			  GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
				GetPlayerName(playerid, sendername, sizeof(sendername));
				reason = bigstrtok(cmdtext, idx);
				if(!strlen(reason)) return SendClientMessage(playerid, GREY, "USAGE: /freeze [playername/id] [reason]");
				format(string, sizeof(string), "Administrator %s froze %s. [Reason: %s ]", sendername, giveplayername, reason);
	 			SendClientMessageToAdmins(ADMIN_RED, string, 1);
				TogglePlayerControllable(giveplayerid, false);
			}
			else if(giveplayerid == INVALID_PLAYER_ID)
			{
				format(string, sizeof(string), "%d is not an active player.", giveplayerid);
				SendClientMessage(playerid, GREY, string);
			}
		}
		else SendClientMessage(playerid, GREY, "You are not an admin with the required level.");
		return 1;
	}

I add this After this:

new giveplayerid = ReturnUser(tmp);
if(giveplayerid != INVALID_PLAYER_ID)
Reply


Messages In This Thread
Help with Admin Cmds - by Taz86 - 11.03.2009, 20:05
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 20:11
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 20:14
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 20:17
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 20:21
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 20:22
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 20:25
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 20:34
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 20:38
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 20:47
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 20:53
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 20:56
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 21:05
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 21:07
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 21:10
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 21:14
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 21:54
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 21:56
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 21:58
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 21:59
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 22:00
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 22:09
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 22:14
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 22:15
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 22:18
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 22:26
Re: Help with Admin Cmds - by Pyrokid - 11.03.2009, 22:28
Re: Help with Admin Cmds - by Taz86 - 11.03.2009, 22:33

Forum Jump:


Users browsing this thread: 1 Guest(s)