Immediate Help
#1

Well, hello guys. I fixed almost all bugs in my Vehicle system, but now another appeared. The Vehicles load perfectly, but they don't set their NUMBERPLATES 'that perfectly'. :/
What I think is, that some vehicles DO NOT respawn, and their numberplate gets set to the next one, maybe?
For instance, two vehicles have the same numberplate? Why? I mean, just...why? How's it even possible?

And oh my gosh, one has '0'? really?


I have this under OnGameModeInit
pawn Код:
for(new i=1;i<MAX_SCRIPTVEHICLES+1;i++)
    {
        new engine, lights, alarm, doors, bonnet, boot, objective;
AddStaticVehicleEx(VehicleInfo[i][vModel],VehicleInfo[i][vLocX],VehicleInfo[i][vLocY],VehicleInfo[i][vLocZ],VehicleInfo[i][vAngle],
        VehicleInfo[i][vColorOne],VehicleInfo[i][vColorTwo],3600);
        SetVehicleNumberPlate(i,VehicleInfo[i][vPlate]);
        SetVehicleToRespawn(i);
        GetVehicleParamsEx(i,engine,lights,alarm,doors,bonnet,boot,objective);
        SetVehicleParamsEx(i,0,0,alarm,doors,bonnet,boot,objective);
    }
About saving/loading data, I use fwrite method. My Families,Factions,Houses,Businesses system all work perfectly. Please help me. The one who solved me problem gets 3 Reps.
Reply
#2

Wrong.
Reply
#3

What's wrong buddy?
Reply
#4

Anybody? Please?
Reply
#5

Can anybody please hwlp me?
Reply
#6

i believe the problem might be in VehicleInfo[i][vPlate].
you better show the code related about ^ .
Reply
#7

Quote:
Originally Posted by [D]ry[D]esert
Посмотреть сообщение
i believe the problem might be in VehicleInfo[i][vPlate].
you better show the code related about ^ .
Using this in Enumerator.
Код:
vPlate[8]
I use fwrite method to save data.
pawn Код:
public SaveVehicles()
{
    new idx;
    new File: file2;
    while (idx < sizeof(VehicleInfo))
    {
        new coordsstring[512];
        format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%d,%s,%d,%d,%s,%d,%f,%d,%d,%d,%d,%d,%d,%d,%d,%d,%s,%d,%d,%d\n",
                // I have Hidden the rest as they're not required.
        VehicleInfo[idx][vPlate],
        if(idx == 0)
        {
            file2 = fopen("Vehicles/Vehicles.cfg", io_write);
        }
        else
        {
            file2 = fopen("Vehicles/Vehicles.cfg", io_append);
        }
        fwrite(file2, coordsstring);
        idx++;
        fclose(file2);
    }
}
Loading.
pawn Код:
public LoadVehiclesInfo()
{
    new arrCoords[28][64];
    new strFromFile2[256];
    new File: file = fopen("Vehicles/Vehicles.cfg", io_read);
    if (file)
    {
        new idx=0;
        while (idx < sizeof(VehicleInfo))
        {
            fread(file, strFromFile2);
            splitcar(strFromFile2, arrCoords, ',');
                        // Rest of them Hidden again.
            strmid(VehicleInfo[idx][vPlate],arrCoords[24],0,strlen(arrCoords[24]),255);
            idx++;
        }
        fclose(file);
    }
    return 1;
}
That's all about the 'System'. Any help please?
Reply
#8

pawn Код:
if (file)
    {
        new idx=0;
        while (idx < sizeof(VehicleInfo))
        {
            fread(file, strFromFile2);
            splitcar(strFromFile2, arrCoords, ',');
                        // Rest of them Hidden again.
            strmid(VehicleInfo[idx][vPlate],arrCoords[24] ,strlen(arrCoords[24]),255);
            idx++;
        }
        fclose(file);
    }
    return 1;
}
Reply
#9

Quote:
Originally Posted by Hammomd
Посмотреть сообщение
pawn Код:
if (file)
    {
        new idx=0;
        while (idx < sizeof(VehicleInfo))
        {
            fread(file, strFromFile2);
            splitcar(strFromFile2, arrCoords, ',');
                        // Rest of them Hidden again.
            strmid(VehicleInfo[idx][vPlate],arrCoords[24] ,strlen(arrCoords[24]),255);
            idx++;
        }
        fclose(file);
    }
    return 1;
}
Well, that set All Vehicle's Numberplate to 'XYZSR998'.
Reply
#10

Anybody else?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)