- 136
- 55
Оно закрывает диалог но не вводит текст
Lua:
script_name('FastMakeGun')
script_author('Endo')
script_description('Fast create a gun')
require "lib.moonloader"
local sampev = require 'lib.samp.events'
local main_color = 0x06DFFF
local makeDeagle = false
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
------------------------------------Command-------------------------------------
sampRegisterChatCommand("gd", cmd_gd)
--------------------------------------------------------------------------------
wait(-1)
end
---------------------------------------Command function-------------------------
function cmd_gd(arg)
if #arg == 0 then
sampAddChatMessage("AAA", main_color)
else
sampSendChat("/makegun")
sampSendDialogResponse(888, 1, 1, '')
sampSendDialogResponse(889, '', '', arg)
end
return arg
end
-----------------------------------------Samp.lua-------------------------------
function sampev.onShowDialog(id)
if id == 889 then
sampCloseCurrentDialogWithButton(1)
return false
end
end