Jump to content

GUI - need little help


isa_Khamdan

Recommended Posts

Posted (edited)

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
  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted
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 "("

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

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

Posted (edited)

Yes, use outputConsole ( accname ) if you want to output the player's account name.

Edited by Guest
Posted
Yes, use outputConsole ( accname ).

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

Posted

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.

Posted

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 
) 

Posted

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.

Posted

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 )

Posted
You dont have to use an export. You can also try and combine these 2 resources. Would be alot easier and bring less bugs / glitches.

I changed outputconsole to outputChatBox and nothings shows so there is a problem in the codes.

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