Quote:
Originally Posted by Salepate
if you put ADMIN_SLAY you don't need to use cmd_access();
is it wrong ?
besides you wrote
Code:
if ( ! cmd_access(id, level, cid, 0) )
isn't 0 supposed to be ADMIN_ALL ? and if it's the case then none of the players (Admin included) can use the command.
Tell me if I am wrong.
|
No, that's the amount of args, but it will never work. I don't know why he used cmd_access, just use this:
Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define ACCESS ADMIN_SLAY
new Float:g_LastRestart[33]
public plugin_init()
{
register_plugin("Restart","1.0","Hawk552")
register_clcmd("say /restart","say_restart",ACCESS)
}
public say_restart(id)
{
if(!(get_user_flags(id) & ACCESS))
return
new Float:Time = halflife_time()
if(Time - g_LastRestart[id] < 10.0)
return
g_LastRestart[id] = Time
server_cmd("sv_restart 1")
}
Also, please don't screw with the indentation and put your own when you're adding 1 line. Not only does K&R look worse, it's just stupid to make changes like that.
__________________