Sometimes (very rarely) when i'm starting lan server i can't use about half of custom commands. I'm playing with my brother and when i'm trying to enable noclip (code below) or entering other commands i'm receiving nothing (no messages, no noclip), but my bro is receiving "You have no access" messages in console. Commands runs from his client right as if he will run 'em by himself
Sorry for my bad English
//command handling
public fun_main(id) {
new arg[17]
read_argv(1, arg, charsmax(arg))
if (!arg[0]) client_print(id, print_console, "[%s] %s", PLUGIN_NAME, MESSAGE[FUN_USAGE])
else if (equali(arg, "noclip")) toggle_noclip(id)
else if (equali(arg, "god")) toggle_godmode(id) //not included here but it works as toggle_noclip
return PLUGIN_HANDLED
}
public toggle_noclip(id) {
if(get_user_flags(id) & ACCESS_ADMIN) {
if(is_user_alive(id)) {
new x = get_user_noclip(id)
set_user_noclip(id, x == 0 ? 1 : 0)
client_print(id, print_console, "Noclip %s", x == 0 ? "ON" : "OFF")
}
else client_print(id, print_console, "[%s] %s", PLUGIN_NAME, MESSAGE[DEAD_NOW])
}
else client_print(id, print_console, "[%s] %s", PLUGIN_NAME, MESSAGE[NO_ACCESS])
}