Problem in loading files from folder.
#1

Well.. Yeah - I've been working on a new Dealership system.. It should Load the Car from the folder "Cars" once OnGameModeInIt is Called.. So here :

PHP код:
stock LoadCars()
{
    new 
FileName[128];
    new 
carstring[256];
    for(new 
0MAX_CARSi++)
    {
        
format(FileNamesizeof(FileName), "Cars/car_%d.ini"i);
        if(
fexist(FileName))
        {
            
CarInfo[i][CarModel] = dini_Int(FileName"CarModel");
            
CarInfo[i][CarPrice] = dini_Int(FileName"CarPrice");
            
CarInfo[i][CarX] = dini_Float(FileName"CarX");
            
CarInfo[i][CarY] = dini_Float(FileName"CarY");
            
CarInfo[i][CarZ] = dini_Float(FileName"CarZ");
            
CarInfo[i][CarF] = dini_Float(FileName"CarF");
            
CarInfo[i][CarSpawnX] = dini_Float(FileName"CarSpawnX");
            
CarInfo[i][CarSpawnY] = dini_Float(FileName"CarSpawnY");
            
CarInfo[i][CarSpawnZ] = dini_Float(FileName"CarSpawnZ");
            
CarInfo[i][CarSpawnF] = dini_Float(FileName"CarSpawnF");
            
CarInfo[i][CarColor] = dini_Int(FileName"CarColor");
            
CarInfo[i][CarColor] = dini_Int(FileName"CarColor2");
            if(
== 1)
            {
                
format(carstring,sizeof(carstring),"%s For Sale | {FFF1AF}Price: $%d | {6EF83C}ID: %d",vehName[CarInfo[i][CarModel]-400],CarInfo[i][CarPrice],i);
                
CarInfo[i][CarText] = Create3DTextLabel(carstringCOLOR_CAR0.00.00.015.00);
                 
CarInfo[i][CarID] = AddStaticVehicleEx(CarInfo[i][CarModel],CarInfo[i][CarX],CarInfo[i][CarY],CarInfo[i][CarZ],CarInfo[i][CarF],CarInfo[i][CarColor],CarInfo[i][CarColor2],1);
                
Attach3DTextLabelToVehicle(CarInfo[i][CarText], CarInfo[i][CarID], 0.00.00.0);
    
//            SetVehicleVirtualWorld(i,255);
                
CarInfo[i][DealerShipCar] = 1;
            }
            else
            {
                
format(carstring,sizeof(carstring),"%s For Sale | {FFF1AF}Price: $%d | {6EF83C}ID: %d",vehName[CarInfo[i][CarModel]-400],CarInfo[i][CarPrice],i);
                
CarInfo[i][CarText] = Create3DTextLabel(carstringCOLOR_CAR0.00.00.015.00);
                 
CarInfo[i][CarID] = AddStaticVehicleEx(CarInfo[i][CarModel],CarInfo[i][CarX],CarInfo[i][CarY],CarInfo[i][CarZ],CarInfo[i][CarF],CarInfo[i][CarColor],CarInfo[i][CarColor2],1); // Blade ID 56
                
Attach3DTextLabelToVehicle(CarInfo[i][CarText], CarInfo[i][CarID], 0.00.00.0);
                
CarInfo[i][DealerShipCar] = 1;
            }
            
SpawnedCars++;
        }
    }
    return 
1;

The problem that once I Put
PHP код:
LoadCars(); 
under OnGameModeInIt - The Console starts the server without Loading ANYTHING under LoadCars - It doesn't load the objects or anything under it.. It loads all of the things above only

So.. What's the problem ?
Reply
#2

Bump - Been even more than 48 Hour,
Reply
#3

We have been having this EXACT same problem on our server, except nobody has given us an answer yet, and we posted over a week ago. It seems this is a question that SAMP cannot answer. We have been using INI_ParseFile, and we sent multiple PMs to ******, the creator of INI_ParseFile, but we were also simply ignored.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)