Jump to content

Weapon Problem


Recommended Posts

Hello i have little problem i want any player 150 kill zombie unlock silenced weapon but give error. Please help me

attempt to compare number with string

addEvent("Silenced", true) 
addEventHandler("Silenced",root, 
function() 
        local zombiekills = getElementData(source,"Zombie kills") 
        if (zombiekills >= 150) then 
local PlayerMoney = getPlayerMoney(source) 
 if ( PlayerMoney >= 300) then 
    takePlayerMoney(source,300)  
    giveWeapon ( source ,  23,60 ) 
    else 
    outputChatBox ( "Bu silahi alamassınız çünkü levelniz yetmiyor.", source, 255, 0, 0 ) 
    end 
  end 
end 
) 
  

Link to comment
  
addEvent("Silenced", true) 
addEventHandler("Silenced",root, 
function() 
        local zombiekills = tonumber(getElementData(source,"Zombie kills")) 
        if (zombiekills >= 150) then 
local PlayerMoney = getPlayerMoney(source) 
 if ( PlayerMoney >= 300) then 
    takePlayerMoney(source,300) 
    giveWeapon ( source ,  23,60 ) 
    else 
    outputChatBox ( "Bu silahi alamassınız çünkü levelniz yetmiyor.", source, 255, 0, 0 ) 
    end 
  end 
end 
) 
  

Link to comment

thanks i have one more :lol: i how lock button ? i cant it

        GUIEditor.button[2] = guiCreateButton(10, 147, 77, 34, "Pistol\n300$:1 LVL", false, GUIEditor.window[1]) 
  
addEventHandler ("onResourceStart", getRootElement(),  
function(button, state, absoluteX, absoluteY) 
if ( source == GUIEditor.button[1] ) then 
guiSetVisible ( GUIEditor.window[1] , false) 
showCursor ( false )  
elseif ( source ==  GUIEditor.button[2] ) then  
guiSetEnabled ( source,false ) 
end 
end) 
  
  

Link to comment
  
        GUIEditor.button[2] = guiCreateButton(10, 147, 77, 34, "Pistol\n300$:1 LVL", false, GUIEditor.window[1]) 
  
addEventHandler ("onResourceStart", getRootElement(), function() 
guiSetVisible ( GUIEditor.window[1] , false) 
showCursor ( false ) 
guiSetEnabled ( GUIEditor.button[2],false ) 
end) 
  

Link to comment
GUIEditor.button[2] = guiCreateButton(10, 147, 77, 34, "Pistol\n300$:1 LVL", false, GUIEditor.window[1]) 
  
addEventHandler("onClientGUIClick", guiRoot, function(button, state, absoluteX, absoluteY) 
     if source == GUIEditor.button[1] then 
          guiSetVisible(GUIEditor.window[1] , false) 
          showCursor(false) 
     elseif source ==  GUIEditor.button[2] then 
          guiSetEnabled(source, false) 
     end 
end) 

Link to comment
thanks i have one more :lol: i how lock button ? i cant it
        GUIEditor.button[2] = guiCreateButton(10, 147, 77, 34, "Pistol\n300$:1 LVL", false, GUIEditor.window[1]) 
  
addEventHandler ("onClientGUIClick", getRootElement(),  
function(button, state, absoluteX, absoluteY) 
if ( source == GUIEditor.button[1] ) then 
guiSetVisible ( GUIEditor.window[1] , false) 
showCursor ( false )  
elseif ( source ==  GUIEditor.button[2] ) then  
guiSetEnabled ( source,false ) 
end 
end) 
  
  

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