14.01.2013, 18:29
Hi!
Before starting, i must tell you i'm french, so i've a bad (very bad..) english ...
So, i've download this: https://sampforum.blast.hk/showthread.php?tid=355574
And i added this:
But the website tell me:
Warning: fread(): Length parameter must be greater than 0 in C:\xampp\htdocs\SampQuery.class.php on line 112
The script:
The do the test on my computer (local) with XAMPP (yes, i've windows..)
If you must more information for help me, tell me it
Thank you in advance, and i hope you understand me!
Bye!
(Move this post if wrong section)
Before starting, i must tell you i'm french, so i've a bad (very bad..) english ...
So, i've download this: https://sampforum.blast.hk/showthread.php?tid=355574
And i added this:
PHP код:
public function getServerPassword()
{
@fwrite($this->sock, $this->assemblePacket("i"));
fread($this->sock, 11);
$serverInfo = array();
$serverInfo['password'] = (integer) ord(fread($this->sock, 1));
return $serverInfo['password'];
}
Warning: fread(): Length parameter must be greater than 0 in C:\xampp\htdocs\SampQuery.class.php on line 112
The script:
PHP код:
public function getBasicPlayers() {
@fwrite($this->sock, $this->assemblePacket("c"));
fread($this->sock, 11);
$playerCount = ord(fread($this->sock, 2));
$players = array();
if($playerCount > 0) {
for($i = 0; $i < $playerCount; ++$i) {
$strLen = ord(fread($this->sock, 1));
if(!$strLen) { echo "Problиme"; } // I've added it, and it appears correctly
$players[$i] = array
(
"name" => (string) fread($this->sock, $strLen), // Lign 112
"score" => (integer) $this->toInt(fread($this->sock, 4))
);
}
}
return $players;
}
If you must more information for help me, tell me it
Thank you in advance, and i hope you understand me!
Bye!
(Move this post if wrong section)