local x2, y2, z2 = getElementPosition(kolczatka)
kCol [ player ] = createColCuboid ( x2, y2, z2, 3)
Can you post an example on how to do that?
Sure
This will create spikes near a player when you type, /dropspike . It will destroy the vehicle tyres when you drive any vehicle above it.
Server side.
addCommandHandler("dropspike",
function(player)
if (player) then
local x, y, z = getElementPosition(player)
local spikestring = createObject(2899,x+2,y-2,z-0.9)
local x2, y2, z2 = getElementPosition(spikestring)
local coll = createColSphere(x2, y2, z2, 3)
addEventHandler("onColShapeHit",coll,function (player)
if player and getElementType(player) == "player" then
if isPedInVehicle(player) then
local pedoveh = getPedOccupiedVehicle(player)
setVehicleWheelStates(pedoveh,1,1,1,1)
end end
end) end
end)