Jump to content

Get gui txt


top sniper

Recommended Posts

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 by Guest
Link to comment
hi i have a problem with getguitxt

server:

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

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

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