Jump to content

Get gui txt


top sniper

Recommended Posts

Posted (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 by Guest
Posted
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

Posted

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

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

Posted

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) 

Posted
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

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

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