require 'lib.moonloader'
function main()
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand("crashme", function()
sampAddChatMessage("crash", -1)
SendCoords(1,1,1)
end)
while true do wait(0)
if sampIsDialogActive() and sampGetCurrentDialogId() == 15039 then
SendCoords(1,1,1)
end
end
end
function SendCoords(x, y, z)
local data = allocateMemory(18)
setStructElement(data, 4, 2, 1024, true)
setStructFloatElement(data, 6, x, true)
setStructFloatElement(data, 10, y, true)
setStructFloatElement(data, 14, z, true)
sampSendSpectatorData(data)
freeMemory(data)
end