dima3367 Posted February 23, 2020 Share Posted February 23, 2020 Hi all, tell me why I insert a function for that would not work when entering text binds, but they still work. Here's a piece of code. local window = guiCreateWindow(0.36,0.2, 0.3,0.35, '', true) guiSetVisible(window,false) guiWindowSetSizable(window,false) local grid = guiCreateGridList(0,0.1, 0.6,1, true, window) local column = guiGridListAddColumn(grid, 'Никнейм', 0.9) guiCreateLabel(0.685,0.1, 1,0.1, 'Поиск по нику:',true,window) local edit_nickname = guiCreateEdit(0.63,0.17, 1,0.1, '',true,window) guiSetInputMode("no_binds_when_editing") guiCreateLabel(0.685,0.3, 1, 0.1, 'Срок (в минутах):', true, window) local edit = guiCreateEdit(0.63,0.37, 1,0.1, '', true,window) local button = guiCreateButton(0.63,0.48, 1,0.1, 'Посадить',true,window) addEventHandler('onClientGUIClick',button,function() if source ~= button then return end local detention = tonumber(guiGetText(edit)) if not detention then return end local nick = guiGridListGetSelectedText(grid,1) triggerServerEvent('server:arrest',localPlayer,nick,detention) end) Link to comment
Haxardous Posted February 23, 2020 Share Posted February 23, 2020 this section is not related to scripting support, MTA’s client support only. go here: https://forum.multitheftauto.com/forum/71-scripting/ Link to comment
ReZurrecti0n Posted February 24, 2020 Share Posted February 24, 2020 Why not just place the function under onClientResourceStart? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now