AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   Commands only for specific players (https://forums.alliedmods.net/showthread.php?t=330874)

OG420 02-24-2021 12:46

Commands only for specific players
 
2 Attachment(s)
Hello,

i want to make some commands usable only for specific players. As far as i understant it can be done with admin_overrides.cfg and admins_simple.ini. I tried it but it doesnt work. Any help will be appreciated, thank you.

Sreaper 02-25-2021 20:15

Re: Commands only for specific players
 
I don't see anything wrong with your attached files. I went ahead and Google'd sm_stickers and saw that it's using RegConsoleCmd. You will need to change your plugin commands located within in the source code to use RegAdminCmd if you want your overrides to work.


Code:

void LoadCommands()
{
    RegConsoleCmd("sm_sticker", Command_Stickers);
    RegConsoleCmd("sm_stickers", Command_Stickers);
    RegConsoleCmd("sm_st", Command_Stickers);
}

->

Code:

void LoadCommands()
{
    RegAdminCmd("sm_sticker", Command_Stickers, ADMFLAG_GENERIC, "Toggle stickers");
    RegAdminCmd("sm_stickers", Command_Stickers, ADMFLAG_GENERIC, "Toggle stickers");
    RegAdminCmd("sm_st", Command_Stickers, ADMFLAG_GENERIC, "Toggle stickers");
}


TomL. 02-25-2021 21:27

Re: Commands only for specific players
 
You are not giving permissions to an specific player but rather allow everyone with a specific flag to use the command. Anyway try replacing RegConsoleCmd with RegAdminCmd as Sreaper suggested.

Bacardi 02-26-2021 01:01

Re: Commands only for specific players
 
*edit
https://github.com/pmrowla/sourcemod...ngelog.txt#L51
Quote:

Originally Posted by SM 1.5.0
- Added the ability to override RegConsoleCommand-created commands (bug 5199).

You not need edit plugin source code, to replace RegConsoleCmd -> RegAdminCmd
Just add command in admin_overrides.cfg

Answer to first post, I don't know.
Need to see admin cache dump and link to the plugin source code. I won't start search, because there can be 4 different version suddenly.


All times are GMT -4. The time now is 14:02.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.