Lua:
script_name('kicker')
--script_author('')
script_version('0.1')
local sampev = require 'lib.samp.events'
function main()
while not isSampAvailable() do wait(100) return end
sampRegisterChatCommand("hkick", hkick)
wait(-1)
end
function hkick(playerID, vehID)
if tonumber(playerID, vehID) then
local result, pHandle = sampGetCharHandleBySampPlayerId(playerID)
if result then
local res = doesCharExist(pHandle)
if res then
local carResult, vehHandle = sampGetCarHandleBySampVehicleId(vehID)
local vehExist = isCarOnScreen(vehHandle)
if vehExist then
targX, targY, targZ = getCharCoordinates(pHandle)
setCarCollision(vehHandle, 1)
sampForceTrailerSync(vehID)
else
sampAddChatMessage("Vehicle is not in the stream zone!", -1)
end
else
sampAddChatMessage("Player is not in the stream zone!", -1)
end
end
else
sampAddChatMessage("Enter values!", -1)
end
end
function sampev.onSendTrailerSync(data)
data.position.x = targX
data.position.y = targY
data.position.z = targZ
end