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
350x20_FFFFFF_FFFFFF_000000_000000.png
  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted

acc isn't defined.

Replace getAccountName(acc) at line 6 with accname.

Please do not PM me with scripting related question nor support, use the forums instead.

Posted

accname already is returning the account name.

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

Please do not PM me with scripting related question nor support, use the forums instead.

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

350x20_FFFFFF_FFFFFF_000000_000000.png
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.

Please do not PM me with scripting related question nor support, use the forums instead.

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?

350x20_FFFFFF_FFFFFF_000000_000000.png
Posted (edited)

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

Edited by Guest

Please do not PM me with scripting related question nor support, use the forums instead.

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

350x20_FFFFFF_FFFFFF_000000_000000.png
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.

Please do not PM me with scripting related question nor support, use the forums instead.

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 
) 

350x20_FFFFFF_FFFFFF_000000_000000.png
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.

Please do not PM me with scripting related question nor support, use the forums instead.

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 )

350x20_FFFFFF_FFFFFF_000000_000000.png
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.

350x20_FFFFFF_FFFFFF_000000_000000.png
Posted

That function is used to output a message to the client console ( F8 ).

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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