Jump to content

GUI - need little help


isa_Khamdan

Recommended Posts

What is wrong with this code?

It is triggered server event

addEventHandler('Spawn',root, 
  
    function() 
        local account = getPlayerAccount(source) -- get account element from player element 
        local accname = getAccountName(account) -- get account name from account element 
        if isObjectInACLGroup("user." .. getAccountName(accname),aclGetGroup("PCS")) then 
        outputConsole ( "accname" )  
         
    end 
end 
) 

Edited by Guest
Link to comment
  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

accname already is returning the account name.

As i said, replace getAccountName(accname) with accname variable.

addEvent('Spawn',true) 
  
addEventHandler('Spawn',root, 
  
    function() 
        local account = getPlayerAccount(source) -- get account element from player element 
        local accname = getAccountName(account) -- get account name from account element 
        if isObjectInACLGroup("user."(accname),aclGetGroup("PCS")) then 
        outputConsole ( "accname" )  
         
    end 
end 
) 

Now I am getting error in the line 8 ")" expected near "("

Link to comment
addEvent('Spawn',true) 
  
addEventHandler('Spawn',root, 
  
    function() 
        local account = getPlayerAccount(source) -- get account element from player element 
        local accname = getAccountName(account) -- get account name from account element 
        if isObjectInACLGroup("user."..accname,aclGetGroup("PCS")) then 
        outputConsole ( "accname" ) 
        
    end 
end 
) 

Try it.

Link to comment
addEvent('Spawn',true) 
  
addEventHandler('Spawn',root, 
  
    function() 
        local account = getPlayerAccount(source) -- get account element from player element 
        local accname = getAccountName(account) -- get account name from account element 
        if isObjectInACLGroup("user."..accname,aclGetGroup("PCS")) then 
        outputConsole ( "accname" ) 
        
    end 
end 
) 

Try it.

No errors but the function doesn't work is there any mistake with outputconsole?

Link to comment

It doesn't work , the account name in the console will spawn a vehicle and when I type my name it spawn it but using this GUI it doesn't work I think there still a mistake in the outputconsole

Any errors in debugscript?

I see no error in the outputConsole function.

Link to comment

It doesn't work , the account name in the console will spawn a vehicle and when I type my name it spawn it but using this GUI it doesn't work I think there still a mistake in the outputconsole

Any errors in debugscript?

I see no error in the outputConsole function.

There are no errors at all is the problem from the trigger in the client side?

Client side part

addEventHandler("onClientGUIClick", root, function() 
  if source == PCSbutton3 then 
triggerServerEvent('Spawn',localPlayer) 
  end 
end 
) 

Link to comment

There are no errors at all is the problem from the trigger in the client side?

No, it seems to be correct.

I still didn't understand what you want to do.

I have a gui , I want to make that when you click the selected button it will output your account name to the console and doing that will spawn a vehicle from another resource ( if I do it manually and type my name in the console it works but using the gui doesn't work :S )

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