format(nomefile,sizeof(nomefile),"%s.txt",biz[t][bizname]);
if(!$file=fopen("$GameDir/scriptfiles/property.cfg","r")) die("Error reading bizzfile");
<?php
$path = "PATH_TO_FILE";
$bizname = "BIZNAME_HERE";
$file = $path . $bizname;
if(file_exists($file, "r") == true)
{
$file_content = file_get_contents($file);
// Content of the buziness file is now in $file_content
}
else
{
die("Error reading bizz file " . $file);
}
function GetPlayerHouseInfo($user)
{
require "config.php";
if(!$file=fopen("$GameDir/scriptfiles/Casa233.txt","r")) die("Error reading bizzfile");
while (($data=fgetcsv($file,1024, "|")) !== FALSE)
{
if($data[14] == $user)
{
$datanew = array(
"owner" => $data[0],
"id" => $data[1],
"housecash" => $data[2],
"interiorpack" => $data[3],
"garage" => $data[4],
"PriceProd" => $data[5]
);
return $datanew;
}
}
}
I have houses saving as " Casa " but they many like Casa1.txt , Casa2.txt to Casa800.txt[/php]
|