ghassen14 Posted November 13, 2015 Share Posted November 13, 2015 Hello guys i need a code when a player click on the botton he will get M4 gun . Link to comment
EH10 Posted November 13, 2015 Share Posted November 13, 2015 Event 'onClientGUIClick' or bindKey triggerServerEvent , giveWeapon Weapon Number : 31 Note ! Link to comment
</Mr.Tn6eL> Posted November 13, 2015 Share Posted November 13, 2015 Event 'onClientGUIClick' or bindKey triggerServerEvent , giveWeapon Weapon Number : 31 Note ! bindKey for keyboard keys not gui button Link to comment
EH10 Posted November 13, 2015 Share Posted November 13, 2015 Event 'onClientGUIClick' or bindKey triggerServerEvent , giveWeapon Weapon Number : 31 Note ! bindKey for keyboard keys not gui button # هـو يقول يـبي .. زر يضغطه ويعطيه سلاح Link to comment
ghassen14 Posted November 13, 2015 Author Share Posted November 13, 2015 Event 'onClientGUIClick' or bindKey triggerServerEvent , giveWeapon Weapon Number : 31 Note ! bindKey for keyboard keys not gui button i want gui botton Link to comment
EH10 Posted November 13, 2015 Share Posted November 13, 2015 Event 'onClientGUIClick' or bindKey triggerServerEvent , giveWeapon Weapon Number : 31 Note ! bindKey for keyboard keys not gui button i want gui botton onClientGUIClick Link to comment
swedishboy Posted November 13, 2015 Share Posted November 13, 2015 A bit bored so i've made it for you Client side: GUIEditor = { button = {}, window = {} } function thewindow () GUIEditor.window[1] = guiCreateWindow(702, 455, 118, 115, "Weapon", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) showCursor (true) GUIEditor.button[1] = guiCreateButton(20, 79, 79, 26, "Close", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(9, 25, 99, 36, "M4", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", GUIEditor.button[1], closee, false ) addEventHandler("onClientGUIClick", GUIEditor.button[2], getm4, false ) end addCommandHandler("wep", thewindow) function closee () guiSetVisible ( GUIEditor.window[1], false ) showCursor(false) end function getm4 (weaponID, ammo) guiSetVisible(GUIEditor.window[1], true) showCursor(true) triggerServerEvent( "getm", getLocalPlayer(),weaponID, ammo) end Server side: function getWep ( weaponID, ammo ) giveWeapon(source, 31, 500) outputChatBox ( "#FF0000You got a M4 with #00FF00500 #FF0000Ammo", source, 255, 255, 255, true ) end addEvent("getm", true) addEventHandler("getm", getRootElement(), getWep) open the window with /wep Link to comment
ghassen14 Posted November 14, 2015 Author Share Posted November 14, 2015 A bit bored so i've made it for youClient side: GUIEditor = { button = {}, window = {} } function thewindow () GUIEditor.window[1] = guiCreateWindow(702, 455, 118, 115, "Weapon", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetAlpha(GUIEditor.window[1], 1.00) showCursor (true) GUIEditor.button[1] = guiCreateButton(20, 79, 79, 26, "Close", false, GUIEditor.window[1]) GUIEditor.button[2] = guiCreateButton(9, 25, 99, 36, "M4", false, GUIEditor.window[1]) addEventHandler("onClientGUIClick", GUIEditor.button[1], closee, false ) addEventHandler("onClientGUIClick", GUIEditor.button[2], getm4, false ) end addCommandHandler("wep", thewindow) function closee () guiSetVisible ( GUIEditor.window[1], false ) showCursor(false) end function getm4 (weaponID, ammo) guiSetVisible(GUIEditor.window[1], true) showCursor(true) triggerServerEvent( "getm", getLocalPlayer(),weaponID, ammo) end Server side: function getWep ( weaponID, ammo ) giveWeapon(source, 31, 500) outputChatBox ( "#FF0000You got a M4 with #00FF00500 #FF0000Ammo", source, 255, 255, 255, true ) end addEvent("getm", true) addEventHandler("getm", getRootElement(), getWep) open the window with /wep Thank you very much 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