Scripting/Server/Classes/Vehicle/SetTexture

(v0.3.5+) Replaces a texture on ONE car with an image of LU/decals (the original comes back with an empty string ""). SetTexture matches the texture name used by the car's model (case-insensitive, e.g. the name of a livery or plate texture of a custom vehicle); SetRimTexture replaces whatever textures the four wheels use - custom rims. Other cars of the same model are not affected. Synced to every player.

Syntax

vehicle.SetTexture("texturename", "image")
vehicle.SetRimTexture("image")

Arguments

Example

function onPlayerCommand( player, cmd, params )
{
	if ( cmd == "settexture" )
	{
		local veh = player.Vehicle;
		if ( !veh ) return MessagePlayer( "Sit in a vehicle first.", player );
		veh.SetTexture( 0, 0 );
	}
}

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

Section: Vehicle

Categories: Server methods | Vehicle