PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#define PLUGIN "nctest"
#define VERSION "1.0"
#define AUTHOR "wEight"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /nc", "cmd_nc")
}
public cmd_nc(id)
{
if(is_user_alive(id))
{
if(get_user_noclip(id) == 0)
{
set_user_noclip(id, 1)
client_print(id, print_chat, "Noclip On")
set_task(5.0, "expire_nc")
}
else
{
client_print(id, print_chat, "Already have noclip")
}
}
return PLUGIN_HANDLED
}
public expire_nc(id)
{
if(is_user_alive(id))
{
set_user_noclip(id, 0)
client_print(id, print_chat, "Noclip Expired")
}
return PLUGIN_HANDLED
}
expire_nc(id) wont work, when use set_user_noclip and client_print only without if(is_user_alive(id)) it gives me an error for set_user_noclip.
Translation: When i get noclip, it passes 5 seconds and i still have noclip, It's supposed to expire.