Jump to content

Help Please :')


Recommended Posts

Posted

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 
  

Posted
addEventHandler("onPlayerLogin", root, 
function() 
    outputChatBox(getPlayerName(source).."has logged in as "..aclGroupGetName(aclGetGroup()), 211, 211, 211) 
end) 

Posted

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) 

Posted
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?

Posted (edited)
  
    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
Posted

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

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