SRCDS Steam group


Tutorial: Send a RCON command to a server with PHP
#16
Hello, I added few functions in this script, but I have problem... I added this:

$date=date("Y-m-d_H:i:s");

And this is a small piece of full script:

// Ip address and port
$_ip = '192.168.1.109' ; // server ip
$_port = '27015'; // server port
$_password = '123' ; // your rcon password
$s2 = '';
$command = 'say $date'; // the rcon command! Put the command you want here
$requestId = 1;

So I have problems with this line: $command = 'say $data'; , how I can fix it, that in my server will be written data? I had tried this methods:
$command = 'say "echo $date"';
$command = 'echo $date';
$command = 'echo "echo $date"';
Reply
#17
Going to make a control panel from this. Big Grin
Reply
#18
(03-21-2009, 04:14 AM)alfredas Wrote:  So I have problems with this line: $command = 'say $data'; , how I can fix it, that in my server will be written data? I had tried this methods:
$command = 'say "echo $date"';
$command = 'echo $date';
$command = 'echo "echo $date"';

$command = "say ".$date;
~ trewq
Reply
#19
I would say

Code:
$command = 'say '.$date;
Would look cleaner considering the kind of quotes you use more...
Looking for a game server? Visit fullfrag.com and pick one up as low as $2.50 / mo!
Reply
#20
(10-23-2009, 06:18 AM)loopyman Wrote:  I would say

Code:
$command = 'say '.$date;
Would look cleaner considering the kind of quotes you use more...

Yes but you could also do:

PHP Code:
$command "say $date"
~ trewq
Reply
#21
True :3
Looking for a game server? Visit fullfrag.com and pick one up as low as $2.50 / mo!
Reply
#22
Lolx...Thanks for share with us good posting
Reply
#23
This is very helfull thank you for posting.
“I am always doing things I can’t do. That is how I get to do them.” -Pablo Picasso

Reply
#24
this is AWESOME, just what i was looking for.
It does work great, runs the command pretty well but for some reason, it will randomly hang for about one minute or less.
I have also noticed that my server console prints: rcon from xxx.xxx.xxx.xxx:61152 for instance, and on the next command, the port number increments +1, so 61153.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)