AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   how to run a command through other plugin (https://forums.alliedmods.net/showthread.php?t=147473)

BackStats 01-09-2011 15:29

how to run a command through other plugin
 
I need the plugin1 execute the command of plugin2.

cmd plugin2:
PHP Code:

register_concmd"say topmap" "TopMap" ); 

plugin1:
????

the plugin1 will be called by another plugin and when that happens the plugin1 must run the command plugin2

reinert 01-09-2011 15:34

Re: how to run a command through other plugin
 
Not possible, only if you will register command in plugin2, such a register_clcmd("lala")

then in plugin1 use client_cmd(id, "lala")

GXLZPGX 01-09-2011 15:40

Re: how to run a command through other plugin
 
Quote:

Originally Posted by reinert (Post 1390044)
Not possible, only if you will register command in plugin2, such a register_clcmd("lala")

then in plugin1 use client_cmd(id, "lala")

Yes it is.

server_cmd( "command" ) executes commands from the console.

BackStats 01-09-2011 15:53

Re: how to run a command through other plugin
 
then in plugin2 I should change to:
PHP Code:

register_srvcmd"topmap" "TopMap" ); 

and use in plugin1:
PHP Code:

server_cmd ("topmap"

??

I should just put this in plugin1? it will execute the command?

GXLZPGX 01-09-2011 16:00

Re: how to run a command through other plugin
 
Quote:

Originally Posted by BackStats (Post 1390054)
then in plugin2 I should change to:
PHP Code:

register_srvcmd"topmap" "TopMap" ); 

and use in plugin1:
PHP Code:

server_cmd ("topmap"

??

I should just put this in plugin1? it will execute the command?

If you want anyone to be able to type topmap, then you can use:

Code:
register_clcmd( "topmap", "TopMap" );

and execute it from the plugin:

Code:
server_cmd( "topmap" )

fysiks 01-09-2011 16:02

Re: how to run a command through other plugin
 
No.

It depends on what you are doing. What does the "TopMap" function do and how is it defined?


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

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