addEventHandler("onClientResourceStart", resourceRoot,
function()
wnd = guiCreateWindow(455, 191, 425, 227, "", false)
guiWindowSetSizable(wnd, false)
butt1 = guiCreateButton(14, 30, 133, 32, "deagle", false, wnd)
butt2 = guiCreateButton(199, 38, 150, 34, "shotgun", false, wnd)
butt3 = guiCreateButton(300, 10, 150, 34, "2", false, wnd)
ebox = guiCreateEdit(139, 111, 182, 45, "", false, wnd)
addEventHandler( "onClientGUIClick", butt1, function()
if (source==butt1) then
slot1= tostring(guiGetText (ebox))
bindKey(slot1,"down",function()
cslot1= getPedWeaponSlot ( localPlayer )
if ((2-cslot1) > 0) then
for i =1,(2-cslot1) do
setControlState ( "next_weapon", true )
outputChatBox("next_fail")
end
elseif((2-cslot1)<0) then
for i =1,(cslot1-2) do
setControlState ( "previous_weapon", true )
outputChatBox("pre_fail")
end
end
end)
end
end)
end)
that's when i tried "next_weapon" control.
addEventHandler("onClientResourceStart", resourceRoot,
function()
wnd = guiCreateWindow(455, 191, 425, 227, "", false)
guiWindowSetSizable(wnd, false)
butt1 = guiCreateButton(14, 30, 133, 32, "deagle", false, wnd)
butt2 = guiCreateButton(199, 38, 150, 34, "shotgun", false, wnd)
butt3 = guiCreateButton(300, 10, 150, 34, "2", false, wnd)
ebox = guiCreateEdit(139, 111, 182, 45, "", false, wnd)
addEventHandler( "onClientGUIClick", butt1, function()
if (source==butt1) then
slot1= tostring(guiGetText (ebox))
bindKey(slot1,"down",function()
setPedWeaponSlot (localPlayer,2)
end)
end
end)
addEventHandler( "onClientGUIClick", butt2, function()
if (source==butt2) then
slot2= tostring(guiGetText (ebox))
bindKey(slot2,"down",function()
setPedWeaponSlot (localPlayer,3)
end)
end
end)
end)
that one when i tried to bind one key for 2 functions
only the 2nd entered function will work.