|
Senior Member
Join Date: Feb 2021
Location: Russia
|
07-01-2021
, 09:17
Re: Cmds taking wrong executor's id
|
#4
|
Quote:
Originally Posted by fysiks
Are you using HLDS or a listen server (clicking "New Game")?
|
listen server
i think no need to use HLDS to play together in one room
Quote:
Originally Posted by jimaway
use register_clcmd()
|
it have the same behavior
used with bhop. When i'm entering "bh" it toggles bhop not for me but for my brother
PHP Code:
public plugin_init() { ... register_clcmd("bh", "toggle_bhop", ACCESS_USER, _) ... }
public toggle_bhop(executor, who) { if(!who) who = executor if(get_pcvar_num(mp_bhop_ban)) { client_print(who, print_console, BHOP_BANNED) return PLUGIN_HANDLED } new pname[MAX_NAME_LENGTH] get_user_name(who, pname, charsmax(pname)) if(!g_bhop[who]) g_bhop[who] = 1 else g_bhop[who] = 0 new szPrefix[3] szPrefix = (g_bhop[who] == 1 ? "en" :"dis") client_print(who, print_console, "Bhop %sabled", szPrefix)
new pnum = get_playersnum() for (new player = 1; player < pnum; player++) { if(get_user_flags(player) & ACCESS_ADMIN) { client_print(player, print_console, "[%s] %s (ID:%i) %sabled bh", PLUGIN_NAME, pname, who, szPrefix) client_print(player, print_chat, "[%s] %s (ID:%i) %sabled bh", PLUGIN_NAME, pname, who, szPrefix) } } return PLUGIN_HANDLED }
Last edited by kww; 07-01-2021 at 10:28.
|
|
|
|