Gastonito Posted January 5, 2017 Share Posted January 5, 2017 Hello For The 2nd Time Today Guys I need a function to disable weapons, its like in an event panel and so when pressing a button the weapons gets disabled, anyone can help with this ? i just need the func, i can do the onClientGUIClick and the other things .. Link to comment
^iiEcoo'x_) Posted January 5, 2017 Share Posted January 5, 2017 getPlayerWeapon setElementData getElementData takeWeapon Link to comment
Gastonito Posted January 5, 2017 Author Share Posted January 5, 2017 6 minutes ago, #_iMr,[E]coo said: getPlayerWeapon setElementData getElementData takeWeapon Hey Can u write the full func please ? and btw there must be a fucn to enable weapons again ... Link to comment
^iiEcoo'x_) Posted January 5, 2017 Share Posted January 5, 2017 (edited) . @Angel02 -- # Client local getPlayerWeapon = G addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[1] ) then if G (localPlayer) == 30 then setElementData ( localPlayer,"Data",G ) if getElementData(localPlayer,"Data") then triggerServerEvent("Dis", localPlayer, G) end end end ) -- # Server addEvent('Dis', true) addEventHandler('Dis',root, function(G) takeWeapon ( source , G ) end ) Edited January 5, 2017 by #_iMr,[E]coo Link to comment
Gastonito Posted January 5, 2017 Author Share Posted January 5, 2017 6 minutes ago, #_iMr,[E]coo said: . uhm ? Link to comment
^iiEcoo'x_) Posted January 5, 2017 Share Posted January 5, 2017 Just now, Angel02 said: uhm ? Up ^^ Link to comment
Gastonito Posted January 5, 2017 Author Share Posted January 5, 2017 1 minute ago, #_iMr,[E]coo said: Up ^^ what about to make them back ? Link to comment
^iiEcoo'x_) Posted January 5, 2017 Share Posted January 5, 2017 -- # Client addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[2] ) then setElementData ( localPlayer,"Data",false ) end end ) Link to comment
Gastonito Posted January 5, 2017 Author Share Posted January 5, 2017 28 minutes ago, #_iMr,[E]coo said: -- # Client addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor.button[2] ) then setElementData ( localPlayer,"Data",false ) end end ) Thx m8, could u PM me please I need help with this too, i made this func : addEvent("CancelLeaving", true) function CancelLeaving () for eventPlayers in pairs(WrapedPlayers) do cancelEvent () exports.SAEGcommands:sendMessage("Vehicles Leaving Has Been Disabled By "..getPlayerName(client), 255, 0, 0,eventPlayers) end end addEventHandler ( "onVehicleStartExit", getRootElement(), cancelEvent ) but im getting a warning saying : [18:14:09] WARNING: Bad argument @ 'cancelEvent' [Expected bool at argument 1, got player] Link to comment
^iiEcoo'x_) Posted January 5, 2017 Share Posted January 5, 2017 Welcome addEvent("CancelLeaving", true) function CancelLeaving () for eventPlayers in pairs(WrapedPlayers) do exports.SAEGcommands:sendMessage("Vehicles Leaving Has Been Disabled By "..getPlayerName(client), 255, 0, 0,eventPlayers) cancelEvent () end end addEventHandler ( "onVehicleStartExit", getRootElement(), Link to comment
Gastonito Posted January 5, 2017 Author Share Posted January 5, 2017 (edited) nvm ... 20 minutes ago, #_iMr,[E]coo said: Welcome addEvent("CancelLeaving", true) function CancelLeaving () for eventPlayers in pairs(WrapedPlayers) do exports.SAEGcommands:sendMessage("Vehicles Leaving Has Been Disabled By "..getPlayerName(client), 255, 0, 0,eventPlayers) cancelEvent () end end addEventHandler ( "onVehicleStartExit", getRootElement(), [18:44:44] WARNING: [Helps]/AA/event_server.lua:398: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] ... Edited January 5, 2017 by Angel02 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