Help with vehicle system
#6

Im trying to use the same sort of system.

It appears the problem comes from the size of an array called VehicleCreate which is called in VehicleLoad.
The line of error is the last one.(the one that isn't indented)
pawn Код:
stock VehicleLoad(vehicleID, file[])
{
    INI_ParseFile(file, "LoadVehicleData", .bExtra = true, .extra = vehicleID);
    //new pname(MAX_PLAYER_NAME];
    format(pname,sizeof pname,"%s",VehicleInfo[vehicleID][vOwner]);
VehicleCreate(VehicleInfo[vehicleID][vModel],VehicleInfo[vehicleID][vLoc], VehicleInfo[vehicleID][vColor1], VehicleInfo[vehicleID][vColor2], VehicleInfo[vehicleID][vRespawn],pname, VehicleInfo[vehicleID][vLocked]);
}
And this is the VehicleCreate function;
pawn Код:
stock VehicleCreate(vehicleModel, Float:vehicleLoc[4], vehicleColor1, vehicleColor2, vehicleRespawn, vehicleOwner[], bool:vehicleLocked)
// This is our most important function. This will create the vehicle with the valid information provided on the arguments.
{
    new vehicleid = VehicleGetFreeSlot(); // Get the free slot and store it on the vehicleid variable.
    //Now, we will basically put the information from the arguments to our newly created vehicle's array.
    VehicleInfo[vehicleid][vModel] = vehicleModel; // Assign our vehicle's model id to the model id provided.
    VehicleInfo[vehicleid][vLoc] = vehicleLoc; // Assign our vehicle's position/rotation to the position/rotation provided.
    VehicleInfo[vehicleid][vColor1] = vehicleColor1; // Assign our vehicle's primary color to the primary color provided.
    VehicleInfo[vehicleid][vColor2] = vehicleColor2; // Assign our vehicle's secondary color to the secondary color provided.
    VehicleInfo[vehicleid][vRespawn] = vehicleRespawn; // Assign our vehicle's respawn time to the respawn time provided.
    format(VehicleInfo[vehicleid][vOwner], MAX_PLAYER_NAME, vehicleOwner); // Assign our vehicle's owner name to the owner name provided.
    VehicleInfo[vehicleid][vLocked] = vehicleLocked; // Assign our vehicle's lock data to the lock data provided.
    VehicleInfo[vehicleid][vID] = CreateVehicle(vehicleModel, vehicleLoc[0], vehicleLoc[1], vehicleLoc[2], vehicleLoc[3], vehicleColor1, vehicleColor2,
    vehicleRespawn); // Now we are doing two things. We are creating our vehicle on the sa-mp world based on the data provided as well as assigning the
    // sa-mp vehicle id to our system's vehicle id so that we can alter it later.
    vCreated[vehicleid] = true; // Tell our vehicle management variable that this vehicle creation has been done and it's now on the system.
    VehicleLock(vehicleid, VehicleInfo[vehicleid][vLocked]); // Toggle our vehicle's door based on the parameter.
   
    return vehicleid; // Return the newly created vehicle's system id.
}
Reply


Messages In This Thread
Help with vehicle system - by MadafakaPro - 07.04.2013, 13:04
Re: Help with vehicle system - by RajatPawar - 07.04.2013, 13:07
Re: Help with vehicle system - by park4bmx - 07.04.2013, 13:10
Re: Help with vehicle system - by MadafakaPro - 07.04.2013, 13:12
Re: Help with vehicle system - by park4bmx - 07.04.2013, 13:16
Re: Help with vehicle system - by EiresJason - 07.04.2013, 13:29
Re: Help with vehicle system - by MadafakaPro - 07.04.2013, 13:31
Re: Help with vehicle system - by CJay9209 - 07.04.2013, 22:12
Re: Help with vehicle system - by park4bmx - 08.04.2013, 15:18
Re: Help with vehicle system - by MadafakaPro - 08.04.2013, 16:58

Forum Jump:


Users browsing this thread: 3 Guest(s)