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
- any "texturename"
- any "image"
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.
Related pages
- vehicle.Remove
- vehicle.Respawn
- vehicle.Fix
- vehicle.Explode
- vehicle.SetBurstableTyres
- player.AttachTo
- object.AttachTo
- object.AttachToBone
- vehicle.SetComponentStatus
- vehicle.SetComponentStatus
- vehicle.SetComponentAngle
- vehicle.SetComponentColour
Section: Vehicle
Categories: Server methods | Vehicle