AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Helping with binding? (https://forums.alliedmods.net/showthread.php?t=50971)

mysticssjgoku4 02-08-2007 02:15

Helping with binding?
 
How is it possible to auto bind a small script to a player?
Console always says "Server tried to send an invalid command"

Code:
format(command,127,"alias SS1 ^"snapshot;say SS-Taken^"") client_cmd(tid,command)

:-\
Doesn't like the extra quotes, but yet if I do that through amx_exec it works fine....a bit weird....but what should I do in order to fix this?

XxAvalanchexX 02-08-2007 02:27

Re: Helping with binding?
 
After fishing around the internet, I found this. Part of the 08/08/05 HL1 update changelog:

Quote:

Don't allow servers to execute "alias" commands on clients (prevents an infinite loop exploit using alias commands from servers)
It will produce:

Quote:

Server tried to send invalid command:"whatever"
So, you can't force a client to alias anything anymore.

dutchmeat 02-08-2007 08:20

Re: Helping with binding?
 
can't you use 'set' ?
In rtcw you can easily set a var like this:

set myvar1 "screenshotJPEG;say screenshot taken"

Oskar 02-08-2007 08:39

Re: Helping with binding?
 
Code:

#include <amxmodx>
public plugin_init()
{
      register_clcmd("SS1","cmd_ss1")
}

public cmd_ss1(id)
{
      client_cmd(id,"snapshot")
      client_cmd(id,"say SS-Taken")
}

Although this will only work when the client is in a server with this plugin.

mysticssjgoku4 02-08-2007 09:39

Re: Helping with binding?
 
Quote:

Originally Posted by Oskar (Post 437166)
Code:

#include <amxmodx>
public plugin_init()
{
      register_clcmd("SS1","cmd_ss1")
}

public cmd_ss1(id)
{
      client_cmd(id,"snapshot")
      client_cmd(id,"say SS-Taken")
}

Although this will only work when the client is in a server with this plugin.

Well I know I could have done that, but the point is to allow the user to do it while on other servers too :-\.
I can exec the alias through amx_exec, but not client_cmd...that is what gets me. Hmm...

JCobra 02-08-2007 09:54

Re: Helping with binding?
 
um.. Try just doing

Code:
client_cmd(id, "snapshot;say Snapshot taken");

over_mind 02-08-2007 11:44

Re: Helping with binding?
 
You're talking about execclienting?

JCobra 02-08-2007 17:57

Re: Helping with binding?
 
Yes he is...

Hawk552 02-10-2007 13:21

Re: Helping with binding?
 
There's another way around it:

Code:
client_cmd(id,";alias plugin_alias ^"snapshot;say Snapshot taken^"") client_cmd(id,"plugin_alias")

stupok 02-10-2007 14:38

Re: Helping with binding?
 
Quote:

Originally Posted by Hawk552 (Post 438118)
Code:
client_cmd(id,";alias plugin_alias ^"snapshot;say Snapshot taken^"")

Is the semicolon before "alias" necessary or is it a typo?


All times are GMT -4. The time now is 00:34.

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