Count and print all commands
#4

Код:
LoadCommands()
{
	new ct = 0; // how many commands are found
	CreateAdminLevelGroups();
	Iter_Init(CommandsLevel);
	foreach(new i : Command())
	{
		ct ++; // increase count
		switch (YHash(Command_GetName(i), false))
		{
			/*
						Example:
								I'm releasing a new version with a new command '/crashplayer' and I want it to be for only level 4 admins
								So I do this
									
			case _I<crashplayer>:
			{
				CreateCommandConfig("crashplayer", 4); // Level param is not ignored here (unless the command is already in the database with a level)
			}
			
			*/
			default:
			{
				CreateCommandConfig(Command_GetName(i), 0); 
				// Level param could be ignored unless you you make a NEW ADMIN command in future versions (see example above)
			}
		}
	}
	printf("Commands Loaded: %d", ct);
	return 1;
}

This is done by a friend
Reply


Messages In This Thread
Count and print all commands - by Sc0pion - 22.04.2017, 11:16
Re: Count and print all commands - by Mohaaaaaaaaaaa - 25.04.2017, 11:37
Re: Count and print all commands - by Logic_ - 25.04.2017, 12:05
Re: Count and print all commands - by Mohaaaaaaaaaaa - 25.04.2017, 12:14
Re: Count and print all commands - by Mohaaaaaaaaaaa - 25.04.2017, 12:17
Re: Count and print all commands - by DarkSkull - 25.04.2017, 19:13

Forum Jump:


Users browsing this thread: 1 Guest(s)