- 344
- 125
Почему при наведении прицела на игрока и пкм+1 скрипт вызывает ошибку в чат и крашит? Вот код:
require "lib.moonloader"
local skezzyeban = require "lib.samp.events"
function main()
while not isSampAvailable() do wait(0) end
while true do wait(0)
if isKeyDown(2) and isKeyJustPressed(49) then
result, ped = getCharPlayerIsTargeting(PLAYER_PED)
if result then
r, i = sampGetPlayerIdByCharHandle(ped)
if r then
sampSendChat('/take '..i)
end
end
end
end
end
function skezzyeban.onShowDialog(id, style, title, b1, b2, text)
if id == 7779 then
sampSendDialogResponse(7779, 1, 6, nil)
end
if id == 109 then
sampSendDialogResponse(109, 1, nil, nil)
end
end
require "lib.moonloader"
local skezzyeban = require "lib.samp.events"
function main()
while not isSampAvailable() do wait(0) end
while true do wait(0)
if isKeyDown(2) and isKeyJustPressed(49) then
result, ped = getCharPlayerIsTargeting(PLAYER_PED)
if result then
r, i = sampGetPlayerIdByCharHandle(ped)
if r then
sampSendChat('/take '..i)
end
end
end
end
end
function skezzyeban.onShowDialog(id, style, title, b1, b2, text)
if id == 7779 then
sampSendDialogResponse(7779, 1, 6, nil)
end
if id == 109 then
sampSendDialogResponse(109, 1, nil, nil)
end
end