slot0 = require("lib.samp.events")
slot1 = nil
slot2 = 0
slot3 = 0
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then
return
end
repeat
wait(0)
until isSampAvailable()
sampRegisterChatCommand("kill", function (slot0)
if active then
active = false
msg("\\xc4\\xe5\\xe0\\xea\\xf2\\xe8\\xe2\\xe8\\xf0\\xee\\xe2\\xe0\\xed")
return
end
if select(1, sampGetCharHandleBySampPlayerId(slot0)) then
if not sampIsLocalPlayerSpawned() then
msg("\\xc5\\xe1\\xeb\\xee, \\xec\\xee\\xe6\\xe5\\xf2 \\xea \\xf1\\xe5\\xf0\\xe2\\xe5\\xf0\\xf3 \\xef\\xee\\xe4\\xea\\xeb\\xfe\\xf7\\xe8\\xf8\\xfc\\xf1\\xff?")
return
end
if sampIsPlayerPaused(slot0) then
msg("\\xd2\\xfb \\xe4\\xee\\xeb\\xe1\\xee\\xb8\\xe1 \\xe8\\xeb\\xe8 \\xea\\xe0\\xea? \\xcd\\xe5 \\xe2\\xe8\\xe4\\xe8\\xf8\\xfc \\xee\\xed \\xe0\\xf4\\xea \\xf1\\xf2\\xee\\xe8\\xf2?")
return
end
active = not active
msg(active and "\\xc0\\xea\\xf2\\xe8\\xe2\\xe8\\xf0\\xee\\xe2\\xe0\\xed" or "\\xc4\\xe5\\xe0\\xea\\xf2\\xe8\\xe2\\xe8\\xf0\\xee\\xe2\\xe0\\xed")
lua_thread.create(rvan, slot0)
else
msg("\\xd7\\xf3\\xf7\\xe5\\xeb\\xee, \\xf2\\xfb \\xe5\\xe3\\xee \\xe2\\xe8\\xe4\\xe8\\xf8\\xfc? \\xc2\\xee\\xf2 \\xe8 \\xff \\xed\\xe5\\xf2!")
end
end)
wait(-1)
end
function rvan(slot0)
uv1 = 0
uv0 = 0
while active do
wait(0)
slot1, slot2 = sampGetCharHandleBySampPlayerId(slot0)
if slot2 and isCharDead(slot2) then
active = false
msg("\\xd5\\xe0\\xf5\\xf5\\xe0\\xef\\xf5\\xef, \\xeb\\xee\\xf8\\xe0\\xf0\\xe0 \\xf1\\xe4\\xee\\xf5 \\xe1\\xeb\\xff\\xf2\\xfc, \\xee\\xf0\\xf3 \\xf1\\xf3\\xea\\xe0.")
end
if not slot1 then
active = false
msg("\\xc4\\xee\\xeb\\xe1\\xee\\xb8\\xe1 \\xeb\\xe8\\xe2\\xed\\xf3\\xeb!")
break
end
uv2 = slot0
if not isCharInAnyCar(slot2) then
px, py, pz = getCharCoordinates(slot2)
x, y, z = getOffsetFromCharInWorldCoords(slot2, 0, 3, 0)
else
px, py, pz = getCarCoordinates(getCarCharIsUsing(slot2))
x, y, z = getOffsetFromCarInWorldCoords(getCarCharIsUsing(slot2), 0, 3, 0)
end
slot3 = getCharHeading(slot2)
printStringNow("~R~SLAP~W~:~B~ " .. sampGetPlayerNickname(slot0) .. "~W~[~R~" .. select(2, sampGetPlayerIdByCharHandle(slot2)) .. "~W~]~N~~B~DEV~W~: ~G~00DD00 ~W~ or ~R~NN - NoName", 1)
end
uv2 = nil
setCharCoordinates(PLAYER_PED, x, y, z)
end
function quat(slot0)
slot1, slot2, slot3, slot4 = getCharQuaternion(slot0)
slot5 = {
convertQuaternionToMatrix(slot4, slot1, slot2, slot3)
}
slot5[1] = -slot5[1]
slot5[2] = -slot5[2]
slot5[4] = -slot5[4]
slot5[5] = -slot5[5]
slot5[7] = -slot5[7]
slot5[8] = -slot5[8]
slot6, slot7, slot8, slot9 = convertMatrixToQuaternion(slot5[1], slot5[2], slot5[3], slot5[4], slot5[5], slot5[6], slot5[7], slot5[8], slot5[9])
return slot6, slot7, slot8, slot9
end
function msg(slot0)
sampAddChatMessage("{FFFFFF}[{00DD00}Rvanka{FFFFFF}] {FF0000}- {FFC000}" .. tostring(slot0), 9109759)
end
function getMoveSpeed(slot0, slot1)
moveSpeed = {
z = 0,
x = math.sin(-math.rad(slot0)) * slot1,
y = math.cos(-math.rad(slot0)) * slot1
}
return moveSpeed
end
function slot0.onSendPlayerSync(slot0)
slot1, slot2 = sampGetCharHandleBySampPlayerId(uv0)
if not active then
return
end
if uv0 == nil then
return
end
if not slot1 then
return
end
if getCharHeading(slot2) >= 180 then
slot3 = -slot3
end
slot3 = math.abs(slot3 + 180)
uv1 = uv1 + 0.3
if uv1 >= 1.55 then
uv1 = 1.55
end
slot0.moveSpeed = getMoveSpeed(slot3, uv1)
if slot0.moveSpeed.z < 0 then
slot0.moveSpeed.z = -0.25
else
slot0.moveSpeed.z = 0.25
end
if not isCharInAnyCar(slot2) then
px, py, pz = getCharCoordinates(slot2)
x, y, z = getOffsetFromCharInWorldCoords(slot2, 0, 3, 0)
else
px, py, pz = getCarCoordinates(getCarCharIsUsing(slot2))
x, y, z = getOffsetFromCarInWorldCoords(getCarCharIsUsing(slot2), 0, 3, 0)
end
slot0.position = {
x,
y,
z - 0.5
}
slot0.quaternion[0], slot5, slot6, slot0.quaternion[3] = quat(slot2)
slot0.quaternion[1] = 0
slot0.quaternion[2] = 0
return slot0
end
function slot0.onSendVehicleSync(slot0)
slot1, slot2 = sampGetCharHandleBySampPlayerId(uv0)
if not active then
return
end
if uv0 == nil then
return
end
if not slot1 then
return
end
if getCharHeading(slot2) >= 180 then
slot3 = -slot3
end
slot3 = math.abs(slot3 + 180)
uv1 = uv1 + 0.1
if uv1 >= 1.65 then
uv1 = 1.65
end
slot0.moveSpeed = getMoveSpeed(slot3, uv1)
if slot0.moveSpeed.z < 0 then
slot0.moveSpeed.z = -0.25
else
slot0.moveSpeed.z = 0.25
end
if not isCharInAnyCar(slot2) then
px, py, pz = getCharCoordinates(slot2)
x, y, z = getOffsetFromCharInWorldCoords(slot2, 0, 3, 0)
else
px, py, pz = getCarCoordinates(getCarCharIsUsing(slot2))
x, y, z = getOffsetFromCarInWorldCoords(getCarCharIsUsing(slot2), 0, 3, 0)
end
slot0.position = {
x,
y,
z - 0.5
}
slot0.quaternion[0], slot5, slot6, slot0.quaternion[3] = quat(slot2)
slot0.quaternion[1] = 0
slot0.quaternion[2] = 0
return slot0
end