Help with this command
#1

The other day i was playing on my server with the ladmin script and giving randoms admin so they would stay, and then somone banned me so now im trying to make all admin commands so there not possible to use on the owner, i made a PlayerInfo[playerid][Owner] thingy and set it to a file, but I cant get it to work on my /mute command heres the code

Код:
if(strcmp(cmd,"/mute",true) == 0)
{
	new tmp[256];
	new id;
	tmp = strtok(cmdtext,idx);
	id = strval(tmp);
	if (Logged[playerid] == 1)
	{
	 	if(!strlen(tmp))
	  	{
	  	   	SendClientMessage(playerid,ORANGE,"USAGE: /mute ID");
			return 1;
		}
		    if(PlayerInfo[id][Owner] == 0)
		    {
			    if(PlayerInfo[playerid][Level] > 2)
			    {
			        if(!IsPlayerConnected(id))
			        {
			            SendClientMessage(playerid,YELLOW,"Invalid ID");
					}

					else
					{
						new string[128];
						new name[MAX_PLAYER_NAME];
						GetPlayerName(playerid,name,sizeof(name));
						new nname[MAX_PLAYER_NAME];
						GetPlayerName(id,nname,sizeof(nname));
						format(string,sizeof(string)," * You have muted %s *",nname);
						SendClientMessage(playerid,YELLOW,string);
						format(string,sizeof(string)," * you have been muted by %s for 10 Minutes!",name);
						SendClientMessage(id,BRIGHTRED,string);
						SetTimerEx("MuteTimer", 600000, false, "i", id);
						PlayerInfo[id][Muted] = 1;
						return 1;
					}

				}
				else
				{
				    SendClientMessage(playerid,ORANGE,"You Have to be Level 3 to use this command");
				    return 1;
				}
			}
			else
			{
			    SendClientMessage(playerid,GREY,"You cannot use this command on the owner!");
			    return 1;
			}
	}
	else
	{
	    SendClientMessage(playerid,ORANGE,"You have to be logged in to use this command!");
		return 1;
	}
	return 1;
}
also if its possible, would I be able to just put something before all the commands that says something like if hes the owner no commands will work on him, so i dont have to add them to every command
Reply


Messages In This Thread
Help with this command - by mrcoolballs - 23.08.2010, 07:30
Re: Help with this command - by Yamoo - 23.08.2010, 07:46
Re: Help with this command - by mrcoolballs - 23.08.2010, 08:41
Re: Help with this command - by Dudits - 23.08.2010, 08:52
Re: Help with this command - by mrcoolballs - 23.08.2010, 09:01

Forum Jump:


Users browsing this thread: 3 Guest(s)