Jump to content

New player auto-team script??


Recommended Posts

Hey, I'm trying to make a script so that when a new player registers, they are automatically assigned to a team called ''Survivors''. Everything works fine except for the core part of it :roll: , new players aren't automatically assigned to it.

Here's my script:

*Spawn part*

function login()
local taccount = getPlayerAccount ( source )
if isZarAccount(taccount) then
setPlayerTeam ( source, team)
outputChatBox ("You're a survivor.", source)
spawnPlayer (source, 246.61526489258, 1860.2613525391, 14.084012985229, 90, 70, team )
fadeCamera (source, true)
setCameraTarget (source, true)
else
end

*isZarAccount part*

function isZarAccount(account)
local nick = ""
local group = aclGetGroup("Everyone")
if (account and group) then
   nick = string.lower(getAccountName(account) or "")
for _, object in ipairs(aclGroupListObjects(group) or {}) do
if (gettok(object, 1, string.byte('.')) == "user") then
if (nick == string.lower(gettok(object, 2, string.byte('.')))) then
return true

---------------------------------------------------------------------------------

I think the problem is that it doesn't automatically assign new players to the Everyone acl group.

Can anyone help?

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...