Car owner with 3dtext label
#1

hello guys

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?

Car Data Code
Код:
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;
}
Help me please
Reply
#2

Exemple code :
Код:
new Text3D:vehicle3Dtext[MAX_VEHICLES],vehicle_id;
// Creating the TextLabel for later use
 
public OnGameModeInit ( )
{
    vehicle_id = CreateVehicle( 510, 0.0. 0.0, 15.0, 5, 0, 120 );
    vehicle3Dtext[ vehicle_id ] = Create3DTextLabel( "Example Text", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
    //Creating the Vehicle
    //Attaching Text Label To Vehicle
    Attach3DTextLabelToVehicle( vehicle3Dtext[ vehicle_id ] , vehicle_id, 0.0, 0.0, 2.0);
}
public OnGameModeExit ( )
{
    Delete3DTextLabel( vehicle3Dtext[ vehicle_id ] );
    return true;
}
Source to read more about it : https://sampwiki.blast.hk/wiki/Attach3DTextLabelToVehicle
Reply
#3

I already done it for PPC_Housing...It has 7 Warnings but its working.
I Prefer Remove Car System from house system and Use AVS.

Because I ll do it too

Because your house system is not made for this kind of things..and also it has some bugs after i used 3d text label on cars. thats why i will remove car system from the house system.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)