Jump to content

Weapons


ghassen14

Recommended Posts

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
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

Thank you very much

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...