Jump to content

Help Please :')


Recommended Posts

So I have just started Programming recently..

I Started with a simple script which I have trouble continuing it

It's A Script Which When An Staff Member Login , it Should Get His Acl Group Name whether he's an admin or moderator...

Then Says (Player) logged in As (aclGetGroupName)

Here's what I have done but couldn't continue

addEventHandler ("onPlayerLogin",root, 
Function WelcomeStaff () 
  aclGetGroup (player) 
end 
  

Link to comment

Hi,

Try with that:

addEventHandler("onPlayerLogin", root,  
function() 
    local accName = getAccountName(getPlayerAccount(source)) 
    if not accName then return end 
    if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then 
        outputChatBox(getPlayerName(source).." has logged in as Admin!", root, 255, 255, 255, true) 
    end 
end) 

Link to comment
Hi,

Try with that:

addEventHandler("onPlayerLogin", root,  
function() 
    local accName = getAccountName(getPlayerAccount(source)) 
    if not accName then return end 
    if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then 
        outputChatBox(getPlayerName(source).." has logged in as Admin!", root, 255, 255, 255, true) 
    end 
end) 

What About of He is Moderator or another staff level ?Should I repeat the last step?

Link to comment
  
    else if isObjectInACLGroup("user."..accName, aclGetGroup("Moderator")) then 
        outputChatBox(getPlayerName(source).." has logged in as moderator!", root, 255, 255, 255, true) 
    end 
end) 

Should I add that if I want moderator too?

Edited by Guest
Link to comment

It will be somethink like that :

addEventHandler("onPlayerLogin", root, 
function() 
    local accName = getAccountName(getPlayerAccount(source)) 
    if not accName then return end 
    if isObjectInACLGroup("user."..accName, aclGetGroup("Admin")) then 
        outputChatBox(getPlayerName(source).." has logged in as Admin!", root, 255, 255, 255, true) 
    elseif isObjectInACLGroup("user."..accName, aclGetGroup("Moderator")) then 
        outputChatBox(getPlayerName(source).." has logged in as Moderator!", root, 255, 255, 255, true) 
    end 
end) 

And sorry for bad english ;b

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