TheIceman1 Posted March 2, 2013 Share Posted March 2, 2013 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
DNL291 Posted March 2, 2013 Share Posted March 2, 2013 (edited) 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 March 2, 2013 by Guest 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