TheLoolyWiz Posted June 30, 2013 Share Posted June 30, 2013 (edited) Hey guys I got this error when I start my script and my player doesn't spawn: attempt to concatenate local 'accName' (a boolean value) Here a screenshot: http://tinypic.com/r/2lc1o21/5 And here is my code: function joinHandler( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then fadeCamera( source, true) setCameraTarget( source, source) spawnPlayer( source, 1580, -1634, 13, 0, 23) -- (source,x,y,z,rotation,skin,interior,dimension,team) else fadeCamera( source, true) setCameraTarget( source, source) local spawnX, spawnY, spawnZ = 1570.9791259766, -1628.7496337891, 13.3828125 spawnPlayer( source, spawnX, spawnY, spawnZ, 0, math.random (0,288), 0, 0) -- (source,x,y,z,rotation,skin,interior,dimension,team) end end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) addEventHandler("onResourceStart", getRootElement(), joinHandler) Edited June 30, 2013 by Guest Link to comment
iPrestege Posted June 30, 2013 Share Posted June 30, 2013 player - source - thePlayer ? Check the wiki about onResourceStart and onPlayerJoin Event what is the source . Link to comment
TheLoolyWiz Posted June 30, 2013 Author Share Posted June 30, 2013 Ok, now my player spawns but still have same error "attempt to concatenate local 'accName' a boolean value" Link to comment
manawydan Posted June 30, 2013 Share Posted June 30, 2013 try function joinHandler( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then fadeCamera( thePlayer, true) setCameraTarget( thePlayer, thePlayer) spawnPlayer( thePlayer, 1580, -1634, 13, 0, 23) -- (source,x,y,z,rotation,skin,interior,dimension,team) else fadeCamera( thePlayer, true) setCameraTarget( thePlayer, thePlayer) local spawnX, spawnY, spawnZ = 1570.9791259766, -1628.7496337891, 13.3828125 spawnPlayer( thePlayer, spawnX, spawnY, spawnZ, 0, math.random (0,288), 0, 0) -- (source,x,y,z,rotation,skin,interior,dimension,team) end end addEventHandler("onPlayerLogin", getRootElement(), joinHandler) Link to comment
TheLoolyWiz Posted June 30, 2013 Author Share Posted June 30, 2013 Thanks, I solved! I used: function joinHandler() local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then fadeCamera( source, true) setCameraTarget( source, source) spawnPlayer( source, 1580, -1634, 13, 0, 23) -- (source,x,y,z,rotation,skin,interior,dimension,team) else fadeCamera( source, true) setCameraTarget( source, source) local spawnX, spawnY, spawnZ = 1570.9791259766, -1628.7496337891, 13.3828125 spawnPlayer( source, spawnX, spawnY, spawnZ, 0, math.random (0,288), 0, 0) -- (source,x,y,z,rotation,skin,interior,dimension,team) end end addEventHandler("onPlayerLogin", getRootElement(), joinHandler) Link to comment
iPrestege Posted June 30, 2013 Share Posted June 30, 2013 onResourceStart there's no player element . Have fun . 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