12.12.2011, 18:18
How to make it like when someone is online the vehicles spawn( in my script) and that there stand: Car owner: "Ownername" Who can make that for me? Or explain it?
Code for cardata:
EDIT and there is a define:
Code for cardata:
pawn Код:
House_ReplaceVehicle(HouseID, CarSlot)
{
// Setup local variables
new vid, cModel, cPaint, cComponents[14], Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2, Float:Health, cFuel;
new panels, doors, lights, tires;
// Get the data from the already existing vehicle that was parked before
vid = AHouseData[HouseID][VehicleIDs][CarSlot];
cModel = AVehicleData[vid][Model];
cPaint = AVehicleData[vid][PaintJob];
cFuel = AVehicleData[vid][Fuel];
for (new i; i < 14; i++)
cComponents[i] = AVehicleData[vid][Components][i];
Col1 = AVehicleData[vid][Color1];
Col2 = AVehicleData[vid][Color2];
cx = AVehicleData[vid][SpawnX];
cy = AVehicleData[vid][SpawnY];
cz = AVehicleData[vid][SpawnZ];
crot = AVehicleData[vid][SpawnRot];
GetVehicleHealth(vid, Health);
GetVehicleDamageStatus(vid, panels, doors, lights, tires);
// Delete the vehicle and clear the data
Vehicle_Delete(vid);
// Create a new vehicle in the same carslot
vid = House_AddVehicle(HouseID, cModel, cPaint, cComponents, Float:cx, Float:cy, Float:cz, Float:crot, Col1, Col2);
// Update the fuel of the vehicle to the previous setting
AVehicleData[vid][Fuel] = cFuel;
// Update the health to what it was before and update the bodywork
SetVehicleHealth(vid, Health);
UpdateVehicleDamageStatus(vid, panels, doors, lights, tires);
return vid;
}
pawn Код:
// Setup a custom type to hold all data about a vehicle
enum TVehicleData
{
bool:MafiaLoad, // Holds True if the vehicle (or trailer) is carrying a mafia-wanted load
Fuel, // Holds the amount of fuel for this vehicle
BelongsToHouse, // Holds the HouseID to which this vehicle belongs
bool:StaticVehicle, // Holds true if this is a static vehicle
bool:Owned, // Holds true if the vehicle is owned by somebody
Owner[24], // Holds the name of the owned of the vehicle
Model, // Holds the vehicle-model of this vehicle
PaintJob, // Holds the ID of the paintjob applied to the vehicle
Components[14], // Holds all Component-ID's for all components on the vehicle
Color1, // Holds the primary color for this vehicle
Color2, // Holds the secundairy color for this vehicle
NeonLeft, // Holds the neon-object on the left side
NeonRight, // Holds the neon-object on the right side
Float:SpawnX, // Holds the X-coordinate of the parking spot for this vehicle
Float:SpawnY, // Holds the Y-coordinate of the parking spot for this vehicle
Float:SpawnZ, // Holds the Z-coordinate of the parking spot for this vehicle
Float:SpawnRot, // Holds the rotation of the parking spot for this vehicle
bool:Clamped // Holds "true" if the vehicle is clamped by an admin
}