homar Posted May 9, 2011 Share Posted May 9, 2011 Admins Spawn , so i want this one when i login i be in Desert base (A69) but aren't work too function adminSpawn (player) local theAccount = getPlayerAccount(player) if theAccount then local accountName = getAccountName(theAccount) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then spawnPlayer (source, 218, 1867, 13, 0, math.random (211,217), 0, 0, ) end end end addEventHandler ("onPlayerLogin" getElementRoot(), adminspawn) Link to comment
Discord Moderators Zango Posted May 9, 2011 Discord Moderators Share Posted May 9, 2011 onPlayerLogin returns account thePreviousAccount, account theCurrentAccount, bool autoLogin and source as player element. Also you have adminspawn in your addEventHandler, and the function name adminSpawn which doesn't work because LUA is case-sensitive You have an extra comma at line 6 in spawnPlayer too, which is not needed for last arguments. But you got a missing one at line 10 in addEventHandler Its getRootElement() (but use 'root') btw how about this: function adminSpawn (_, acc) local accountName = getAccountName(acc) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then spawnPlayer (source, 218, 1867, 13, 0, math.random (211,217), 0, 0 ) end end addEventHandler ("onPlayerLogin", root, adminSpawn) Link to comment
homar Posted May 9, 2011 Author Share Posted May 9, 2011 but when i die he isn't respawn ! Link to comment
Castillo Posted May 9, 2011 Share Posted May 9, 2011 function adminRespawn () local account = getPlayerAccount(source) if account then local accountName = getAccountName(account) if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then spawnPlayer (source, 218, 1867, 13, 0, math.random (211,217), 0, 0 ) end end end addEventHandler ("onPlayerWasted", root, adminRespawn) Link to comment
homar Posted May 9, 2011 Author Share Posted May 9, 2011 thx , you all , you helped me too much thx guys 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