AddCartProp
Puts one of the game’s models on a cart - it rides with it, on every screen.
model is a mesh of the game’s files (a path ending in .cgf or .cga, as the meshes list
them). It sits in the cart body’s own frame: x metres to its right, y ahead, z up from the body’s origin (a wagon’s
bed is about 1 up, a two-wheeler’s about 0.95), within 8 m, turned by pitch / roll / yaw in degrees and scaled
0.05 - 10. material puts one of the game’s materials (a .mtl path) on it instead of its own. A prop is only drawn:
nothing collides with it and nobody picks it up. A cart takes up to 16; they go with the cart. Change one with
SetCartProp, take it off with RemoveCartProp; admins try models with /cart prop <model> [x y z [yaw [scale]]].
Syntax
Section titled “Syntax”AddCartProp(id, model, x, y, z [, pitch, roll, yaw, scale, material])| Parameter | Type | |
|---|---|---|
id |
number | the cart |
model |
string | the mesh, e.g. "objects/manmade/common_furniture/barrels/barrel_beer.cgf" |
x |
number | metres to the body’s right |
y |
number | metres ahead |
z |
number | metres up |
pitch |
number | degrees; nil = 0 (optional) |
roll |
number | degrees; nil = 0 (optional) |
yaw |
number | degrees; nil = 0 (optional) |
scale |
number | nil = 1 (optional) |
material |
string | a .mtl path of the game’s; nil = the model’s own (optional) |
Returns
Section titled “Returns”number - the prop’s id on this cart (1-16), or nil (not a cart, a bad path or number, 16 already)
Example
Section titled “Example”-- a merchant's cart: two barrels and a sack in the back of a two-wheelerAddCartProp(cart, "objects/manmade/common_furniture/barrels/barrel_beer.cgf", 0.25, -0.7, 0.95)AddCartProp(cart, "objects/manmade/common_furniture/barrels/barrel_b.cgf", -0.25, -0.7, 0.95)AddCartProp(cart, "objects/manmade/common_furniture/sacks/sack_a.cgf", 0, 0.3, 0.95, 0, 0, 40)See also
Section titled “See also”SetCartProp · RemoveCartProp · GetCartProps · SetCartPartMaterial · the Carts group of the index
