Jump to content

Help with Sound Script


Thresh

Recommended Posts

Posted

How can I make this command only for acl group admin and donator?

function helloCommand ( playerSource, commandName ) 
  
    local theTriggerer = getPlayerName ( playerSource ) 
    triggerClientEvent ( "onHello", getRootElement() ) 
    outputChatBox ( theTriggerer .. " #ffffffstarted sound #ff8c00Hello Man#ffffff!", getRootElement(), 255, 255, 255, true ) 
end 

Posted (edited)
function helloCommand ( playerSource, commandName ) 
    local accPlayer = getPlayerAccount(playerSource) 
    local accName = getAccountName(accPlayer) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Donator" ) ) then 
        local theTriggerer = getPlayerName ( playerSource ) 
        triggerClientEvent ( "onHello", getRootElement() ) 
        outputChatBox ( theTriggerer .. " #ffffffstarted sound #ff8c00Hello Man#ffffff!", getRootElement(), 255, 255, 255, true ) 
    end 
end 

Edited by Guest
Posted

It's still dont start the sound or show the text if i use that :/

function helloCommand ( playerSource, commandName ) 
  
    local accPlayer = getPlayerAccount(playerSource) 
    local accName = getAccountName(accName) 
    if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ("user."..accName, aclGetGroup ( "Donator" ) ) then 
        local theTriggerer = getPlayerName ( playerSource ) 
        triggerClientEvent ( "onHello", getRootElement() ) 
        outputChatBox ( theTriggerer .. " #ffffffstarted sound #ff8c00Hello Man#ffffff!", getRootElement(), 255, 255, 255, true ) 
    end 
end 

Posted

By the way you can limit usage of the command for other players by passing "true" as the third argument to addCommandHandler. Then you will have to add a right "command.yourCommandName" to the acls you want to use.

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