isa_Khamdan Posted August 11, 2013 Share Posted August 11, 2013 (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 August 11, 2013 by Guest Link to comment
DNL291 Posted August 11, 2013 Share Posted August 11, 2013 acc isn't defined. Replace getAccountName(acc) at line 6 with accname. Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 acc isn't defined.Replace getAccountName(acc) at line 6 with accname. I defined it now but it still not working? Link to comment
DNL291 Posted August 11, 2013 Share Posted August 11, 2013 accname already is returning the account name. As i said, replace getAccountName(accname) with accname variable. Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 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
DNL291 Posted August 11, 2013 Share Posted August 11, 2013 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
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 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
DNL291 Posted August 11, 2013 Share Posted August 11, 2013 (edited) Yes, use outputConsole ( accname ) if you want to output the player's account name. Edited August 11, 2013 by Guest Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 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 Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 Client side part addEventHandler("onClientGUIClick", root, function() if source == PCSbutton3 then triggerServerEvent('Spawn',localPlayer) end end ) Link to comment
DNL291 Posted August 11, 2013 Share Posted August 11, 2013 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
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 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
DNL291 Posted August 11, 2013 Share Posted August 11, 2013 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. Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 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 ) Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 How can I do this functions in client side without trigger server event or just tell me how to fix it Link to comment
golanu21 Posted August 11, 2013 Share Posted August 11, 2013 that will spawn a vehicle from another resource you need to use export there Link to comment
tosfera Posted August 11, 2013 Share Posted August 11, 2013 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. Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 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. Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 okay the script worked and it show my name in console but I want it to type my name as a command not just showing it there. Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 Anyone know how to use command in outputconsole? Link to comment
isa_Khamdan Posted August 11, 2013 Author Share Posted August 11, 2013 (edited) outputConsole("text") "text" will be the command? Edited August 11, 2013 by Guest Link to comment
Castillo Posted August 11, 2013 Share Posted August 11, 2013 That function is used to output a message to the client console ( F8 ). Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now