Jump to content

وش الغلط في الكود ؟


Recommended Posts

سويت لوحة اسلحه بمود

guieditor

وابغا اربط الزر بالسلاح لاكن ما يضبط هذا الكود

ابغاه يعطي سنايبر

addEventHandler("onClientGUIClick",GUIEditor.button[1],function() 
   if ( source == GUIEditor.button[1]) then 
           showCursor(true) 
           triggerServerEvent ("giveweaponsniper",getLocalPlayer(),giveweaponsniper) 
       end 
   end ) 

Link to comment
اخوي حط كودك كامل
local marker = createMarker(1698.6185302734, 728.02349853516, 10.8203125,"cylinder",2.0,0,255,0,255) 
  
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        GUIEditor.window[1] = guiCreateWindow(315, 133, 674, 528, "weapon shop", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.button[1] = guiCreateButton(29, 139, 100, 22, "sniper", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[2] = guiCreateButton(192, 139, 100, 22, "shotgun", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[3] = guiCreateButton(389, 139, 100, 22, "m4", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[4] = guiCreateButton(548, 139, 100, 22, "mp5", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[5] = guiCreateButton(548, 337, 100, 22, "RPG", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[6] = guiCreateButton(395, 337, 100, 22, "satchel", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[7] = guiCreateButton(192, 337, 100, 22, "teargas", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[8] = guiCreateButton(29, 337, 100, 22, "grenade", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[9] = guiCreateButton(527, 466, 111, 51, "Close", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFAAAAAA") 
  
        GUIEditor.staticimage[1] = guiCreateStaticImage(-329, -220, 93, 61, ":guieditor/images/TearGas.png", false, GUIEditor.button[9]) 
  
        GUIEditor.staticimage[2] = guiCreateStaticImage(29, 41, 0, 9, ":guieditor/images/Sniper.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[3] = guiCreateStaticImage(31, 50, 88, 72, ":guieditor/images/Sniper.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[4] = guiCreateStaticImage(192, 50, 91, 71, ":guieditor/images/shotgun.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[5] = guiCreateStaticImage(197, 228, 91, 79, ":guieditor/images/TearGas.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[6] = guiCreateStaticImage(35, 225, 94, 82, ":guieditor/images/grenade.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[7] = guiCreateStaticImage(558, 54, 89, 75, ":guieditor/images/mp5.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[8] = guiCreateStaticImage(395, 222, 95, 85, ":guieditor/images/satchel.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[9] = guiCreateStaticImage(544, 222, 103, 90, ":guieditor/images/rpg.png", false, GUIEditor.window[1]) 
        GUIEditor.staticimage[10] = guiCreateStaticImage(389, 42, 95, 87, ":guieditor/images/m4.png", false, GUIEditor.window[1]) 
        GUIEditor.button[10] = guiCreateButton(112, 396, 105, 98, "Health", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FFAAAAAA") 
        GUIEditor.button[11] = guiCreateButton(288, 396, 105, 98, "Armor", false, GUIEditor.window[1]) 
        guiSetProperty(GUIEditor.button[11], "NormalTextColour", "FFAAAAAA")    
         
         
    end 
) 
  
  
  
addEventHandler ("onClientGUIClick", root, 
        function() 
        if (source == GUIEditor.button[9] ) then 
         guiSetVisible(GUIEditor.window[1], false) 
         showCursor(false) 
         guiSetInputEnabled(false) 
        end 
    end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function() 
   if ( source == GUIEditor.button[1]) then 
           showCursor(true) 
           triggerServerEvent ("giveweaponsniper",localPlayer) 
       end 
   end ) 
  
  

Link to comment

اخي تفضل

ملاحظة ما مجربه

دي كلينت

local marker = createMarker(1698.6185302734, 728.02349853516, 10.8203125,"cylinder",2.0,0,255,0,255) 
  
GUIEditor = { 
    button = {}, 
    window = {}, 
    staticimage = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
        window1 = guiCreateWindow(315, 133, 674, 528, "weapon shop", false) 
        guiWindowSetSizable(window1, false) 
  
        button1 = guiCreateButton(29, 139, 100, 22, "sniper", false, window1) 
        guiSetProperty(button1, "NormalTextColour", "FFAAAAAA") 
        button2 = guiCreateButton(192, 139, 100, 22, "shotgun", false, window1) 
        guiSetProperty(button2, "NormalTextColour", "FFAAAAAA") 
        button3 = guiCreateButton(389, 139, 100, 22, "m4", false, window1) 
        guiSetProperty(button3, "NormalTextColour", "FFAAAAAA") 
        button4 = guiCreateButton(548, 139, 100, 22, "mp5", false, window1) 
        guiSetProperty(button4, "NormalTextColour", "FFAAAAAA") 
        button5 = guiCreateButton(548, 337, 100, 22, "RPG", false, window1) 
        guiSetProperty(button5, "NormalTextColour", "FFAAAAAA") 
        button6 = guiCreateButton(395, 337, 100, 22, "satchel", false, window1) 
        guiSetProperty(button6, "NormalTextColour", "FFAAAAAA") 
        button7 = guiCreateButton(192, 337, 100, 22, "teargas", false, window1) 
        guiSetProperty(button7, "NormalTextColour", "FFAAAAAA") 
        button8 = guiCreateButton(29, 337, 100, 22, "grenade", false, window1) 
        guiSetProperty(button8, "NormalTextColour", "FFAAAAAA") 
        button9 = guiCreateButton(527, 466, 111, 51, "Close", false, window1) 
        guiSetProperty(button9, "NormalTextColour", "FFAAAAAA") 
  
        staticimage1 = guiCreateStaticImage(-329, -220, 93, 61, ":guieditor/images/TearGas.png", false, GUIEditor.button[9]) 
  
        staticimage2 = guiCreateStaticImage(29, 41, 0, 9, ":guieditor/images/Sniper.png", false, window1) 
        staticimage3 = guiCreateStaticImage(31, 50, 88, 72, ":guieditor/images/Sniper.png", false, window1) 
        staticimage4 = guiCreateStaticImage(192, 50, 91, 71, ":guieditor/images/shotgun.png", false, window1) 
        staticimage5 = guiCreateStaticImage(197, 228, 91, 79, ":guieditor/images/TearGas.png", false, window1) 
        staticimage6 = guiCreateStaticImage(35, 225, 94, 82, ":guieditor/images/grenade.png", false, window1) 
        staticimage7 = guiCreateStaticImage(558, 54, 89, 75, ":guieditor/images/mp5.png", false, window1) 
        staticimage8 = guiCreateStaticImage(395, 222, 95, 85, ":guieditor/images/satchel.png", false, window1) 
        staticimage9 = guiCreateStaticImage(544, 222, 103, 90, ":guieditor/images/rpg.png", false, window1) 
        staticimage10 = guiCreateStaticImage(389, 42, 95, 87, ":guieditor/images/m4.png", false, window1) 
        button10 = guiCreateButton(112, 396, 105, 98, "Health", false, window1) 
        guiSetProperty(button10, "NormalTextColour", "FFAAAAAA") 
        button11 = guiCreateButton(288, 396, 105, 98, "Armor", false, window1) 
        guiSetProperty(button11, "NormalTextColour", "FFAAAAAA")   
        
        
    end 
) 
  
  
  
addEventHandler ("onClientGUIClick", root, 
        function() 
        if (source == button9 ) then 
         guiSetVisible(window1, false) 
         showCursor(false) 
         guiSetInputEnabled(false) 
        end 
    end 
) 
  
  
addEventHandler("onClientGUIClick",root, 
function() 
   if ( source == button1) then 
           showCursor(true) 
           triggerServerEvent ("sniper",localPlayer) 
    end 
end ) 
  
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button2) 
          showCursor(true) 
           triggerServerEvent("shotgun",localPlayer) 
    end 
end ) 
  
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button3) 
          showCursor(true) 
           triggerServerEvent("m4",localPlayer) 
    end 
end ) 
  
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button4) 
          showCursor(true) 
           triggerServerEvent("mp5",localPlayer) 
    end 
end ) 
  
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button5) 
          showCursor(true) 
           triggerServerEvent("RPG",localPlayer) 
    end 
end ) 
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button6) 
          showCursor(true) 
           triggerServerEvent("satchel",localPlayer) 
    end 
end ) 
  
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button7) 
          showCursor(true) 
           triggerServerEvent("teargas",localPlayer) 
    end 
end ) 
  
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button8) 
          showCursor(true) 
           triggerServerEvent("grenade",localPlayer) 
    end 
end ) 
  
  
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button10) 
          showCursor(true) 
             setElementHealth(localPlayer,100) 
    end 
end ) 
  
addEventHandler("onClientGUIClick",root, 
        function() 
          if (source == button11) 
          showCursor(true) 
           triggerServerEvent("Armor",localPlayer) 
    end 
end ) 

ودي سيرفر

addEvent("sniper",true) 
addEventHandler("sniper",root, function() 
giveWeapon(source,34,100) 
end) 
  
addEvent("shotgun",true) 
addEventHandler("shotgun",root, function() 
giveWeapon(source,25,100) 
end) 
  
addEvent("m4",true) 
addEventHandler("m4",root, function() 
giveWeapon(source,31,100) 
end) 
  
addEvent("mp5",true) 
addEventHandler("mp5",root, function() 
giveWeapon(source,29,100) 
end) 
  
addEvent("RPG",true) 
addEventHandler("RPG",root, function() 
giveWeapon(source,35,100) 
end) 
  
addEvent("satchel",true) 
addEventHandler("satchel",root, function() 
giveWeapon(source,40,100) 
end) 
  
addEvent("teargas",true) 
addEventHandler("teargas",root, function() 
giveWeapon(source,,100) --ايدي السلاح 
end) 
  
addEvent("grenade",true) 
addEventHandler("grenade",root, function() 
giveWeapon(source,16,100) 
end) 
  
addEvent("Armor",true) 
addEventHandler("Armor",root, function() 
setPlayerArmor (source,100) 
end) 

ما عرفت وش تقصد ب teargas

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