Code:
// Let's include some stuff
#include <amxmodx>
#include <amxmisc>
// This function is called when the plugin starts, it basically registers the stuff
public plugin_init()
{
// Let's register the plugin
register_plugin("Test (plugin name)","1.0 (version)","Hawk552 (author)")
// "command","function to call"
register_clcmd("amx_admins","showadmins")
}
public showadmins(id,level,cid)
{
// If the person does not have access (everyone does), or did not supply
// only one argument, stop, and tell them how to use it.
if(!cmd_access(id,level,cid,1))
{
return PLUGIN_CONTINUE
}
// Declare our variables
new i, adminsonline
// Simple for loop, cycles through players
for(i = 0;i <= 32;i++)
{
// if the user is an admin
if(is_user_admin(i))
{
// increase the variable adminsonline
adminsonline++
}
}
// print in their console how many admins there are online
client_print(id,print_console,"[AMXX] There are currently %i admins online.",adminsonline)
return PLUGIN_CONTINUE
}
__________________