my plugin is slightly large, show I will only show the bits that are relevant:
Code:
/* VARIABLES */
new PLUGIN[]="Peep Show Server Settings"
new AUTHOR[]="Revelation"
new VERSION[]="1"
new sCmd[64]
/* server_cmd("?") */
new sLive[64]="exec cfgs/live.cfg"
new sKnives[64]="exec cfgs/knives.cfg"
new sPublic[64]="exec cfgs/public.cfg"
new sWar[64]="exec cfgs/war.cfg"
new sRR[64]="sv_restartround 1"
/* REGISTER PLUGIN AND COMMANDS */
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("say /live","cmd_live",ADMIN_KICK,"execute the servers live.cfg")
register_concmd("say /knives","cmd_knives",ADMIN_KICK,"execute the servers knives.cfg")
register_concmd("say /public","cmd_public",ADMIN_KICK,"execute the servers public.cfg")
register_concmd("say /war","cmd_war",ADMIN_KICK,"execute the servers war.cfg")
register_concmd("say /rr","cmd_rr",ADMIN_KICK,"server command: sv_restartround 1")
}
/* AMX NO ACCESS */
public cmd_noaccess(id)
{
client_print(id, print_chat, "You do not have acces to this command.")
return PLUGIN_HANDLED
}
/* RUN COMMAND ON SERVER */
public cmd_run()
{
server_cmd(sCmd)
server_exec()
return PLUGIN_HANDLED
}
/* EXEC LIVE.CFG */
public cmd_live(id, level, cid)
{
if (!cmd_access(id, level, cid, 0)) {
cmd_noaccess(id)
}
copy(sCmd,64,sLive)
cmd_run()
}
Everything works fine, when an admin runs the command "say /live" the server does 3rr etc etc but the problem is when a non admin runs my command. When someone who isnt a non admin trys "say /live" it first displays "you do not have access to this command" but then it goes ahead and executes the comand anyone even though i have "return PLUGIN_HANDLED" in the function cmd_access. Could someone please help me out, im abit lost. thanks Adam