Jump to content

[NEED HELP] '(' expected near...


myonlake

Recommended Posts

Hello,

I would need some help with this one. It tells me an error when I start the resource.

afs-ufo, resource is the name.

This is what is shows:

SCRIPT ERROR: afs-ufo\settings.lua:22: '(' expected near 'toggleGUI'

WARNING: Loading script failed: afs-ufo\settings.lua:22: '(' expected near 'toggleGUI'

addCommandHandler("controlufo", 
    function toggleGUI(thePlayer) 
        if allowAll == false or allowAll == nil then 
            if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ( "Admin" ) ) then 
                triggerClientEvent("ufo:showmainGUI", thePlayer) 
            elseif hasObjectPermissionTo ( thePlayer, "resource.afs-ufo.controlufo", false ) then 
                triggerClientEvent("ufo:showmainGUI", thePlayer) 
            else 
                outputChatBox("#ff0000*UFO: #ffff00The UFO cannot be controlled by you at this time.", thePlayer, 255,255,255,true) 
            end 
        else 
            triggerClientEvent("ufo:showmainGUI", thePlayer) 
        end 
    end 
) 
 

So, anyone can help me with this little bug? ?

Thank you

Edited by myonlake
Link to comment
addCommandHandler("controlufo", 
    function (thePlayer) 
        if allowAll == false or allowAll == nil then 
            if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(thePlayer)), aclGetGroup ( "Admin" ) ) then 
                triggerClientEvent("ufo:showmainGUI", thePlayer) 
            elseif hasObjectPermissionTo ( thePlayer, "resource.afs-ufo.controlufo", false ) then 
                triggerClientEvent("ufo:showmainGUI", thePlayer) 
            else 
                outputChatBox("#ff0000*UFO: #ffff00The UFO cannot be controlled by you at this time.", thePlayer, 255,255,255,true) 
            end 
        else 
            triggerClientEvent("ufo:showmainGUI", thePlayer) 
        end 
    end 
) 

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