SA-MP Forums Archive
CarOwnership - 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: CarOwnership (/showthread.php?tid=239979)



CarOwnership - GeonMake - 14.03.2011

I copied a system from a GM car but I do not read personal cars, why? the way in which I copied tion goes no problem


AW: CarOwnership - xerox8521 - 14.03.2011

show us the script part else we wont able to help you

any Errors / warnings too

and the lines where the errors are..


Re: AW: CarOwnership - GeonMake - 14.03.2011

Quote:
Originally Posted by xerox8521
Посмотреть сообщение
show us the script part else we wont able to help you

any Errors / warnings too

and the lines where the errors are..
I have no error / warning when compiling! everything is perfect but not reading machines (edited by http://forum.sa-mp.com/showthread.ph...t=carownership)


AW: Re: AW: CarOwnership - xerox8521 - 14.03.2011

Quote:
Originally Posted by GeonMake
Посмотреть сообщение
I have no error / warning when compiling! everything is perfect but not reading machines (edited by http://forum.sa-mp.com/showthread.ph...t=carownership)
did you create the [FS]CarOwnership.cfg in your Scriptfiles


Re: AW: Re: AW: CarOwnership - GeonMake - 14.03.2011

Quote:
Originally Posted by xerox8521
Посмотреть сообщение
did you create the [FS]CarOwnership.cfg in your Scriptfiles
I edited cars.cfg me to be in but all in vain ..

pawn Код:
public LoadCar()
{
    new arrCoords[13][64];
    new strFromFile2[256];
    new File: file = fopen("cfg/cars.cfg", io_read);
    if (file)
    {
        new idx = 0;
        while (idx < sizeof(CarInfo))
        {
            fread(file, strFromFile2);
            split(strFromFile2, arrCoords, ',');
            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], 0, strlen(arrCoords[7]), 255);
            strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(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;
}
public SaveCarCoords()
{
    new idx;
    new File: file2;
    while (idx < sizeof(CarInfo))
    {
        new coordsstring[256];
        format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%s,%d,%d\n",
        CarInfo[idx][cModel],
        CarInfo[idx][cLocationx],
        CarInfo[idx][cLocationy],
        CarInfo[idx][cLocationz],
        CarInfo[idx][cAngle],
        CarInfo[idx][cColorOne],
        CarInfo[idx][cColorTwo],
        CarInfo[idx][cOwner],
        CarInfo[idx][cDescription],
        CarInfo[idx][cValue],
        CarInfo[idx][cLicense],
        CarInfo[idx][cOwned],
        CarInfo[idx][cLock]);
        if(idx == 0)
        {
            file2 = fopen("cfg/cars.cfg", io_write);
        }
        else
        {
            file2 = fopen("cfg/cars.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
    return 1;
}



AW: CarOwnership - xerox8521 - 14.03.2011

please add
Код:
[pawn][\pawn]
outside of the script like

change the \ to /

Код:
pawn Код:
public OnGameModeInit()



Re: AW: CarOwnership - GeonMake - 14.03.2011

Quote:
Originally Posted by xerox8521
Посмотреть сообщение
please add
Код:
[pawn][\pawn]
outside of the script like

change the \ to /

Код:
pawn Код:
public OnGameModeInit()
Edited..


Re: CarOwnership - GeonMake - 14.03.2011

Help me please


Re: CarOwnership - GeonMake - 14.03.2011

Resolved Thanks!