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

Sending command from server 1 to server 2 (Seen it somewhere)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blood2k
Senior Member
Join Date: Mar 2014
Old 02-15-2018 , 12:49   Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #1

What's up.. I'm searching all over the place as I lost the .sma for this during a computer restore.

It was just being able to establish and send a command from 1 server to another server. It was pretty much creating a "challenge id" and then communicating or being able to send a "message" on the other server from server 1.

But I can't find it anywhere by searching google or advanced search methods here. Maybe somebody has it ?
blood2k is offline
D3XT3R
AlliedModders Donor
Join Date: Nov 2016
Location: Lithuania, Bomb A (Kauna
Old 02-15-2018 , 13:24   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #2

using mysql is the only way
__________________
D3XT3R is offline
Send a message via Skype™ to D3XT3R
blood2k
Senior Member
Join Date: Mar 2014
Old 02-15-2018 , 16:34   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #3

edit below:

Last edited by blood2k; 02-16-2018 at 00:17.
blood2k is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 02-16-2018 , 00:09   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #4

Found this

BUT not sure where I would incorporate the command being sent to the IP below... like I want it to send the command amx_advertise

so it can pull the amx_advertise command on that server.. but wheeeeeeree do I incorporate it

Code:
#include <amxmodx>
#include <rcon>

#define SRV_IP      "localhost"
#define SRV_PORT   27015
#define SRV_PASS   "1337"

public plugin_init() {
   register_plugin("RCON Test","test","serfreeman1337")
   
   register_clcmd("amx_rcon_send","Try_Rcon_Send")
}

public Try_Rcon_Send(){
   new cmd[128]
   read_args(cmd,127)
   trim(cmd)
   remove_quotes(cmd)
   
   new st = rcon_send(SRV_IP,SRV_PORT,SRV_PASS,cmd,"rcon_handler")
   
   switch(st){
      case RCON_CONNECTION_FAILED: server_print("[ RCON ] Connection to %s:%d failed successfully",
         SRV_IP,SRV_PORT)
      case RCON_CREATE_FWD_FAIL: server_print("[ RCON ] Forward create failed")
   }
}


public rcon_handler(status,result[]){
   switch(status){
      case RCON_GET_CHALLENGE_FAILED:
         server_print("[ RCON ] Get RCON challenge failed",status)
      case RCON_TIMEOUT:
         server_print("[ RCON ] Query timeout on %s",result)
      case RCON_OK:
         server_print("[ RCON ] Response: ^n%s",result)
   }
}
blood2k is offline
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 02-16-2018 , 13:48   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #5

i want this too
tarsisd2 is offline
PartialCloning
Senior Member
Join Date: Dec 2015
Old 02-16-2018 , 17:54   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #6

Quote:
Originally Posted by blood2k View Post
Found this

BUT not sure where I would incorporate the command being sent to the IP below... like I want it to send the command amx_advertise

so it can pull the amx_advertise command on that server.. but wheeeeeeree do I incorporate it
"I want it to send the command amx_advertise so it can pull the amx_advertise command on that server".

That makes no sense.


The command it uses is amx_rcon_send. You can change the command to anything.
Code:
register_clcmd("amx_rcon_send","Try_Rcon_Send")
->
Code:
register_clcmd("amx_advertise","Try_Rcon_Send")
amx_advertise "say Hello" will print "<Counter-Strike Server> Hello" in chat in the designated server.

Last edited by PartialCloning; 02-16-2018 at 17:55.
PartialCloning is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 02-16-2018 , 22:25   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #7

Ahh yea I know i make no sense... I mean so basically the plugin is a great foundation.. what I'm trying to make it do is.

register_clcmd("say /help","somefunction")

public somefunction
{
and here...... "amx_say admin requested at server 1"
}


Just so people at server 1 when they type /help for example it will send that amx_say "Admin needed"
to the destined server..

better yet it doesnt have to be amx_say but just send ANY cvar to that server without it being connected to
amx_rcon_send "command here"

:p
blood2k is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-17-2018 , 01:01   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #8

Do you still have a question? Based on the example code you posted, you simply change the variable that is currently named "cmd" to whatever command you want to send to the other server. Beyond that, we can't give you much more info than that without a link to the include that you are using.
__________________
fysiks is offline
blood2k
Senior Member
Join Date: Mar 2014
Old 02-17-2018 , 01:34   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #9

This is where the include and og post is : https://forums.alliedmods.net/showthread.php?t=231477


I do still have a question :\ I've been playing with it.. but lets say I need it to send the command

amx_test

to the defined server


so players say /help

and it triggers amx_test to be sent to defined server



I mean the most important thing that I'm trying to achieve is basically..


ppl from server A type /help and it sends rcon message to server B (defined server)

the above example seems like it can be a little too much.. like the whole amx_rcon_send "command here" seems like it's made for admins only.. is there just a simple way to achieve

player types /help
----> server sends "rcon command" to server B

I've already created a basic limit of how often people can type /help ... now just need it to execute on the defined server lol

Last edited by blood2k; 02-17-2018 at 02:01.
blood2k is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-17-2018 , 15:57   Re: Sending command from server 1 to server 2 (Seen it somewhere)
Reply With Quote #10

Simply send your command as the command...

Code:
new cmd[] = "amx_test"
rcon_send(SRV_IP,SRV_PORT,SRV_PASS,cmd,"rcon_handler")
__________________

Last edited by fysiks; 02-17-2018 at 16:05.
fysiks 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 15:16.


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