09.01.2013, 07:52
(
Last edited by DarkPower; 09/01/2013 at 08:53 AM.
)
This is function for YINI int reading...
This is code for show file line value:
The problem is, when i type my nick, in file i have over $150,000 but i see this
http://i.imgur.com/gxGtz.png
The final problem is that yini save line in format
but my code read's like
my code does not recognize the spacing...
PHP Code:
function YINI_IntGet($filename,$key)
{
if(file_exists($filename))
{
$lines = file($filename);
foreach ($lines as $line)
{
$line = rtrim($line);
if(stristr($line, $key."="))
{
$string = str_replace($key."=","",$line);
}
}
}
else
{
return (int)"";
}
return (int)$string;
}
PHP Code:
ftp_chdir($conn_id, "/samp_2700/scriptfiles/Users");
$NICK_ = $_POST['nick'].".ini";
if (ftp_size($conn_id, $NICK_) >= 0)
{
ftp_get($conn_id, "account", $NICK_,FTP_BINARY);
echo "You are viewing stats of ".$_POST['nick']."<br />";
echo "Player has $".YINI_IntGet(NICK_, "Money")." dollars!";
unlink($NICK_);
}
else
{
echo "User ".$_POST['nick']." is not registered!";
}
http://i.imgur.com/gxGtz.png
The final problem is that yini save line in format
Code:
Money = VALUE
Code:
Money=VALUE