SA-MP Forums Archive
LARP Vehicles help. - 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: LARP Vehicles help. (/showthread.php?tid=206499)



LARP Vehicles help. - bn102 - 04.01.2011

When i open my 03c server with the LARP gamemode, it loads fine, and everything seems to work fine. But the ownable vehicles (from cars.cfg) do not load.

Any ideas of how i can fix this?

Thanks,
Ben


Re: LARP Vehicles help. - Krx17 - 04.01.2011

Ask in the LARP gamemode topic.


Re: LARP Vehicles help. - bn102 - 04.01.2011

I got the simple answer "It says its not testing in 03c yet." or something along those lines..


Re: LARP Vehicles help. - Mr. Despair - 04.01.2011

In your script you need to load your cars.cfg... for instance

Код:
public LoadCars()
{
    new arrCoords[5][64];
    new strFromFile2[256];
    new File: file = fopen("cars.cfg", io_read);
    if(file)



Re: LARP Vehicles help. - bn102 - 04.01.2011

Mr Despair, that is there.
PHP код:
public LoadCar()
{
    new 
arrCoords[13][64];
    new 
strFromFile2[256];
    new 
Filefile fopen("cars.cfg"io_read);
    if (
file)
    {
        new 
idx 184;
        while (
idx sizeof(CarInfo))
        {
            
fread(filestrFromFile2);
            
split(strFromFile2arrCoords',');
            
CarInfo[idx][cModel] = strval(arrCoords[0]);
            
CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
            
CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
            
CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
            
CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
            
CarInfo[idx][cColorOne] = strval(arrCoords[5]);
            
CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
            
strmid(CarInfo[idx][cOwner], arrCoords[7], 0strlen(arrCoords[7]), 255);
            
strmid(CarInfo[idx][cDescription], arrCoords[8], 0strlen(arrCoords[8]), 255);
            
CarInfo[idx][cValue] = strval(arrCoords[9]);
            
CarInfo[idx][cLicense] = strval(arrCoords[10]);
            
CarInfo[idx][cOwned] = strval(arrCoords[11]);
            
CarInfo[idx][cLock] = strval(arrCoords[12]);
            
printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
            
idx++;
        }
    }
    return 
1;

^ Where it is loaded.

PHP код:
    for(new 184sizeof(CarInfo); h++)
    {
        
CreateVehicle(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
    } 
^ When vehicles are added, that is below.

I haven't changed anything since downloading, i would like to add. and the problem is on both windows and linux servers....


Re: LARP Vehicles help. - Krx17 - 04.01.2011

It could be the gamemode or where the file is placed or if it exists or not.


Re: LARP Vehicles help. - bn102 - 04.01.2011

I just did a bit more messing about with little bits of code and managed to fix it... There was a number wrong where it was supposed to have 'new CarInfo[268][cInfo];'