Skip to content

Stop Stick

Exports and events

Server exports

deploy

Lays a stick without a player throwing it. c3r's pursuit backup uses this.

local id = exports.lwk_stopstick:deploy(officer, at, angle, from)
ParameterTypeWhat it is
officernumberServer id told about hits
atvector3Where on the road
anglenumberThe stick's line, in degrees (math.deg(math.atan(y, x)) of its direction)
fromvector3?Optional: where it's thrown from, for the throw animation

Returns the stick's id.

remove

Pulls a stick off the road.

exports.lwk_stopstick:remove(id)

useItem

The inventory item's use handler. Point your inventory item at it (see Overview); you won't call it yourself.

Server events

lwk_stopstick:vehicleHit

Fires once per car pass over a stick.

AddEventHandler('lwk_stopstick:vehicleHit', function(d)
    print(('%s burst %d tyres on the %s'):format(GetPlayerName(d.officer), #d.tyres, d.label))
end)
FieldTypeWhat it is
d.sticknumberThe stick's id
d.officernumberServer id of whoever deployed it
d.vehiclenumber | nilThe car's network id
d.labelstringThe car's name
d.tyresnumber[]Tyre indexes that burst
d.coordsvector3Where