Raised This Month: $51 Target: $400
 12% 

Solved why doesn't it work?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iamyounghill
Junior Member
Join Date: Dec 2019
Old 03-09-2020 , 02:44   why doesn't it work?
Reply With Quote #1

hi,everyone!
the code client_cmd is not work anymore when I use it in one plugin.
how to fix it?

Last edited by iamyounghill; 03-10-2020 at 22:58.
iamyounghill is offline
4ever16
Veteran Member
Join Date: Apr 2015
Old 03-09-2020 , 12:03   Re: why doesn't it work?
Reply With Quote #2

engclient_cmd

Last edited by 4ever16; 03-09-2020 at 12:03.
4ever16 is offline
thEsp
BANNED
Join Date: Aug 2017
Old 03-09-2020 , 14:04   Re: why doesn't it work?
Reply With Quote #3

Hello. Please tell us what isn't working specifically. Valve has done quiet a few changes to command availability (restrictions) last year.
thEsp is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-09-2020 , 22:12   Re: why doesn't it work?
Reply With Quote #4

Generally, you should always use either engclient_cmd() or amxclient_cmd() whenever possible but will depend specifically on what commands you are using.

So, either switch to one of these two commands or you'll need to let us know what commands you are sending so that we can help you figure out why they aren't working and how to resolve it.
__________________
fysiks is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-10-2020 , 21:31   Re: why doesn't it work?
Reply With Quote #5

Quote:
Originally Posted by iamyounghill
public server_menu(id)
{
if(is_user_steam(id))
{
client_cmd(id, "rcon amx_set_menu_for #%d",get_user_userid(id));

}


see,"clinet_cmd" has no effect on client?
how to fix it?
I'm sure it's working exactly how it's supposed to work because the user doesn't have rcon access so the command will fail (and potentially ban the user's IP address if attempted too many times). Just send the command to the server with server_cmd() (I'm quite sure that should trigger other plugins' commands).

Also, all users are "Steam" in the context of this forum.
__________________
fysiks is offline
iamyounghill
Junior Member
Join Date: Dec 2019
Old 03-10-2020 , 23:18   Re: why doesn't it work?
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
I'm sure it's working exactly how it's supposed to work because the user doesn't have rcon access so the command will fail (and potentially ban the user's IP address if attempted too many times). Just send the command to the server with server_cmd() (I'm quite sure that should trigger other plugins' commands).

Also, all users are "Steam" in the context of this forum.
But the server_cmd() isn't working like this:server_cmd(index,"command for %d",get_user_useid(index))
iamyounghill is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 03-11-2020 , 07:19   Re: why doesn't it work?
Reply With Quote #7

server_cmd() is sent to the server, not a player, so an index is not needed.
__________________
fysiks is offline
iamyounghill
Junior Member
Join Date: Dec 2019
Old 03-17-2020 , 22:59   Re: why doesn't it work?
Reply With Quote #8

Quote:
Originally Posted by thEsp View Post
Hello. Please tell us what isn't working specifically. Valve has done quiet a few changes to command availability (restrictions) last year.
..
client_cmd(id , "bind k command1")
public command1
{..}
..

when press "K",why it's not working.
iamyounghill is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 03-18-2020 , 00:05   Re: why doesn't it work?
Reply With Quote #9

The server can't bind command on behalf of players, that's why it's not working.
__________________

Last edited by gabuch2; 03-18-2020 at 00:05.
gabuch2 is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 03-18-2020 , 04:00   Re: why doesn't it work?
Reply With Quote #10

Excuse me, I didn't realize it solved the problem

Last edited by alferd; 03-18-2020 at 04:04.
alferd is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:29.


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