Scripting/Server/Classes/Vehicle/GetDecals

(v0.3.5+) Read back what the car carries, e.g. to save a design to a file. GetDecals() returns an array of [id, image, x, y, z, width, height, rx, ry, rz, mirror, alpha, snap]; GetRimTexture() the rim image name or ""; GetTextures() an array of [textureName, image]; GetParts() an array of [part, donorModel, sx, sy, sz, x, y, z, rx, ry, rz].

Syntax

vehicle.GetDecals()
vehicle.GetRimTexture()
vehicle.GetTextures()
vehicle.GetParts()

Returns

array

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "getdecals" )
	{
		local veh = player.Vehicle;
		if ( !veh ) return MessagePlayer( "Sit in a vehicle first.", player );
		local result = veh.GetDecals();
		MessagePlayer( "vehicle.GetDecals returned: " + result, player );
	}
}

This sample was generated from the signature – adapt the values to your gamemode.

Section: Vehicle

Categories: Server methods | Vehicle