top sniper Posted March 17, 2012 Share Posted March 17, 2012 (edited) hi i have a problem with getguitxt server: addEvent("block1",true) addEventHandler("block1",root, function() if currentWeaponID == (txt) then - toggleControl ( source, "fire", false ) end end ) Client: addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if source == block then local text = guiGetText ( idbl ) triggerServerEvent("block1",localPlayer) end end ) Edited March 17, 2012 by Guest Link to comment
top sniper Posted March 17, 2012 Author Share Posted March 17, 2012 hi i have a problem with getguitxtserver: addEvent("block1",true) addEventHandler("block1",root, function() if currentWeaponID == (txt) then --if the weapon ID is minigun toggleControl ( source, "fire", false ) --disable the fire button end end ) Client: addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if source == block then local text = guiGetText ( idbl ) triggerServerEvent("block1",localPlayer) end end ) with this all Weapons will disable Link to comment
GanJaRuleZ Posted March 17, 2012 Share Posted March 17, 2012 1. Make sure "idb1" is definied.. And 2. if currentWeaponID == minigun then And get if the currentWeaponID is definied ( I wrote there minigun , but you need to add the ID.. ) Link to comment
top sniper Posted March 17, 2012 Author Share Posted March 17, 2012 1. Make sure "idb1" is definied..And 2. if currentWeaponID == minigun then And get if the currentID is definied ( I wrote there minigun , but you need to add the ID.. ) You do not understand What I want to .. i made a window for blocking Weapons . Link to comment
TAPL Posted March 17, 2012 Share Posted March 17, 2012 try this (client) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if source == block then blockedWeapon = guiGetText(idbl) end end) function weaponSwitch(previousWeaponID, currentWeaponID) if currentWeaponID == blockedWeapon then toggleControl("fire",false) else toggleControl("fire",true) end end addEventHandler("onClientPlayerWeaponSwitch", getRootElement(), weaponSwitch) Link to comment
top sniper Posted March 17, 2012 Author Share Posted March 17, 2012 try this (client) addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if source == block then blockedWeapon = guiGetText(idbl) end end) function weaponSwitch(previousWeaponID, currentWeaponID) if currentWeaponID == blockedWeapon then toggleControl("fire",false) else toggleControl("fire",true) end end addEventHandler("onClientPlayerWeaponSwitch", getRootElement(), weaponSwitch) it Does not work Link to comment
TAPL Posted March 17, 2012 Share Posted March 17, 2012 addEventHandler ("onClientGUIClick", getRootElement(), function(button, state, absoluteX, absoluteY) if source == block then blockedWeapon = guiGetText(idbl) end end) function weaponSwitch(previousWeaponID, currentWeaponID) local WeaponID = getPedWeapon(localPlayer) if WeaponID == tonumber(blockedWeapon) then toggleControl("fire",false) else toggleControl("fire",true) end end addEventHandler("onClientPlayerWeaponSwitch", getRootElement(), weaponSwitch) 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