Php Command - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Php Command (
/showthread.php?tid=47951)
Php Command -
webflashing - 20.08.2008
Hi everybody, i just have a php script to send Rcon commands to the server.
The thing is, if i send "say lalala", players see the command, but it's not printed in the console.
The code is this:
PHP код:
<?
set_time_limit (30) ;
$ip = $_POST['ip']; if (!$ip) die();
$port = $_POST['port']; if (!$port) die();
$pass = $_POST['pass']; if (!$pass) die();
$passlen = strlen($pass);
$cmd = $_POST['cmd']; if (!$cmd) die();
$cmdlen = strlen($cmd);
$packet = 'SAMP';
$packet .= chr(strtok($ip, '.')).chr(strtok('.')).chr(strtok('.')).chr(strtok('.'));
$packet .= chr($port & 0xFF).chr($port >> 8 & 0xFF);
$packet .= "x";
$packet .= chr($passlen & 0xFF).chr($passlen >> 8 & 0xFF).$pass;
$packet .= chr($cmdlen & 0xFF).chr($cmdlen >> 8 & 0xFF).$cmd;
$fp =fsockopen('udp://' . $ip, $port, $errno, $errstr);
fwrite($fp, $packet);
while(!feof($fp)) {
$str=fread($fp,128);
$str=substr($str,13,strlen($str)-13);
if (!$str) break;
echo $str."<br>";
}
fclose($fp);
?>
So how could i manage to print those messages?
Thanks to all.
Cheers.
---
Web
Re: Php Command -
eXchainZ-FoReVeR - 03.10.2009
I didn't understand your Question, mate.
Re: Php Command -
Mike Garber - 03.10.2009
I can't help but;
He has a command that makes him able to
execute RCON-commands on a PHP-website.
The command works, but It doesn't save the command in the logs (with other words, It doesn't do what
would do in PAWN.
Re: Php Command -
Think - 03.10.2009
public OnRconCommand(cmd[])
{
printf(cmd);
return 1;
}
Re: Php Command -
eXchainZ-FoReVeR - 05.10.2009
mmm? Just use the site
http://sa-mp.mobi
It also works for Computers, and mobiles