Jump to content

GUI problem


Recommended Posts

Why this dont show me Licence GUI(showWepsLWindow)?

Server:

function showWepslicgui ( uPlayer )  
    account = getPlayerAccount( uPlayer ) 
  
    if(getAccountData(account, "licence") == false) then 
  
     triggerClientEvent ( uPlayer, "showWepsLWindow", uPlayer ) 
end 
  
end 
addEventHandler ( "onMarkerHit", guimarkerwep, showWepslicgui ) 
  
  
function weplicence() 
    money = getPlayerMoney(source) 
    account = getPlayerAccount(source) 
    local price = "25000" 
    if(getAccountData(account, "licence") == false) then 
        if(money >= tonumber(price)) then 
            setAccountData(account, "licence", true) 
            takePlayerMoney(source, tonumber(price)) 
                        exports ["guimessages"] : outputServer ( source, "You bought weapon licence,now you can buy weapons!" , 255, 255, 0 ) 
        else 
            exports ["guimessages"] : outputServer ( source, "You don't have enought money!" , 255, 255, 0 ) 
        end 
    end 
     
end 
addEvent("setlic", true) 
addEventHandler("setlic", getRootElement(), weplicence) 
  
  
function showWepsgui ()  
    account = getPlayerAccount(source) 
  
    if ( getAccountData( account, "licence" ) == true ) then 
  
          triggerClientEvent ( source, "showWepsWindow", source ) 
end 
end 
addEventHandler ( "onMarkerHit", guimarkerwep, showWepsgui ) 

Link to comment
function showWepslicgui ( uPlayer ) 
    account = getPlayerAccount( uPlayer ) 
  
    if(getAccountData(account, "licence") == false) then 
  
     triggerClientEvent ( uPlayer, "showWepsLWindow", uPlayer ) 
end 
  
end 
addEventHandler ( "onMarkerHit", guimarkerwep, showWepslicgui ) 
  
  
function weplicence() 
    money = getPlayerMoney(source) 
    account = getPlayerAccount(source) 
    local price = "25000" 
    if(getAccountData(account, "licence") == false) then 
        if(money >= tonumber(price)) then 
            setAccountData(account, "licence", true) 
            takePlayerMoney(source, tonumber(price)) 
                        exports ["guimessages"] : outputServer ( source, "You bought weapon licence,now you can buy weapons!" , 255, 255, 0 ) 
        else 
            exports ["guimessages"] : outputServer ( source, "You don't have enought money!" , 255, 255, 0 ) 
        end 
    end 
    
end 
addEvent("setlic", true) 
addEventHandler("setlic", getRootElement(), weplicence) 
  
  
function showWepsgui (hitPlayer) 
    account = getPlayerAccount(hitPlayer) 
  
    if ( getAccountData( account, "licence" ) == true ) then 
  
          triggerClientEvent ( hitPlayer, "showWepsWindow", hitPlayer ) 
end 
end 
addEventHandler ( "onMarkerHit", guimarkerwep, showWepsgui ) 

Edited by Guest
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...