Makeadmin help
#5

Код:
CMD:setlevel(playerid,params[])
{
	   	   if(pInfo[playerid][pLevel] < 6 && !IsPlayerAdmin(playerid))return ShowMessage(playerid, COLOR_RED, 1);
		   new id,level ,year,month,day,hour,minute,second;
		   if(sscanf(params, "ui", id, level)) return SCM(playerid, 0xFFFF00C8, "[SYSTEM] : /Setlevel <PlayerID> <Level>") ;
           if(level < 0 || level > MaxAdminLevel) return SCM(playerid,-1,"Invalid level(level must be greater than -1)");
           if(!IsPlayerConnected(id))return ShowMessage(playerid, COLOR_RED, 2);
           if(level == pInfo[id][pLevel]) return SCM(playerid,-1,"Player is already in this level!");
		   getdate(year, month, day);
		   gettime(hour,minute,second);
		   switch(level)
		   {
              case 0: LevelName = "Player Status";
              case 1: LevelName = ADMIN_LEVEL_1;
			  case 2: LevelName = ADMIN_LEVEL_2;
			  case 3: LevelName = ADMIN_LEVEL_4;
			  case 4: LevelName = ADMIN_LEVEL_3;
			  case 5: LevelName = ADMIN_LEVEL_5;
			  case 6: LevelName = ADMIN_LEVEL_6;
           }
		   format(Jstring,sizeof(Jstring),"You have given %s level: %d (%s) , Date: %d/%d/%d at %d:%d:%d",GetName(id), level, LevelName, day, month, year ,hour, minute, second);
		   SCM(playerid,COLOR_BLUE,Jstring);
		   if(level > pInfo[id][pLevel])
		   {
			   format(Jstring,sizeof(Jstring),"Admin %s has given you Admin level: %d (%s) <Promoted on %d/%d/%d at %d:%d:%d>",GetName(playerid), level, LevelName ,day, month, year,hour, minute, second),GameTextForPlayerEx(id,"~B~congratulations!~N~~G~Promoted", 2000, 3);
			   SCM(id,COLOR_AQUA,Jstring);
		   }
		   else
		   {
		   format(Jstring,sizeof(Jstring),"Admin %s has set you level: %d <Demoted on %d/%d/%d at %d:%d:%d>",GetName(playerid), level,day, month, year,hour, minute, second),GameTextForPlayerEx(id,"~R~Demoted", 2000, 3);
		   SCM(id,COLOR_RED,Jstring);
		   }
		   pInfo[id][pLevel] = level;
            return 1;
}
I taken it from JLadmin

THis is just Example look that is too easy.
Reply


Messages In This Thread
Makeadmin help - by JXF - 22.05.2016, 12:51
Re: Makeadmin help - by MBilal - 22.05.2016, 12:56
Re: Makeadmin help - by iKevin - 22.05.2016, 12:58
Re: Makeadmin help - by JXF - 22.05.2016, 13:43
Re: Makeadmin help - by MBilal - 22.05.2016, 13:59
Re: Makeadmin help - by J0sh... - 22.05.2016, 14:18
Re: Makeadmin help - by Konstantinos - 22.05.2016, 14:18
Re: Makeadmin help - by JXF - 22.05.2016, 14:32
Re: Makeadmin help - by CSLangdale - 22.05.2016, 16:28
Re: Makeadmin help - by Konstantinos - 22.05.2016, 17:19

Forum Jump:


Users browsing this thread: 1 Guest(s)