iFoReX Posted June 23, 2012 Share Posted June 23, 2012 bad argument lines 2 and 3 server-side here the code : server-side addEventHandler("onResourceStart", resourceRoot, function() local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then for todos, online in ipairs(getElementsByType) do bindKey(online,"F2","down",bindear) end end end ) function bindear() triggerClientEvent(source, "open:pGUI", source) end client-side pedGUI = guiCreateWindow(290,102,773,586,"Creator Ped GUI",false) guiSetVisible(pedGUI, false) showCursor(false) addEvent("open:pGUI", true) addEventHandler("open:pGUI",root,function() if guiGetVisible(pedGUI) == true and showCursor == true then guiSetVisible(pedGUI,false) showCursor(false) elseif guiGetVisible(pedGUI) == false and showCursor == false then guiSetVisible(pedGUI,true) showCursor(true) end end ) Link to comment
Castillo Posted June 23, 2012 Share Posted June 23, 2012 addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, thePlayer in ipairs ( getElementsByType ( "player" ) ) do if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) bindKey ( thePlayer, "F2", "down", bindear ) end end end end ) function bindear ( thePlayer ) triggerClientEvent ( thePlayer, "open:pGUI", thePlayer ) end Link to comment
iFoReX Posted June 23, 2012 Author Share Posted June 23, 2012 attemp to concatenate global 'accName' ( a nil value ) Link to comment
Guest Guest4401 Posted June 23, 2012 Share Posted June 23, 2012 addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, thePlayer in ipairs ( getElementsByType ( "player" ) ) do local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ( "user.".. accName, aclGetGroup ( "Admin" ) ) then bindKey ( thePlayer, "F2", "down", bindear ) end end end ) function bindear ( thePlayer ) triggerClientEvent ( thePlayer, "open:pGUI", thePlayer ) end 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