Arthur3989 Posted June 29, 2015 Posted June 29, 2015 Code on server.lua: function passbase(thePlayer) triggerClientEvent(thePlayer, "senhadabase", getRootElement()) end ----------------------------------------------------------------------------------------------- local gate = createObject( 980, 1541.0999755859, -1627.6999511719, 15.199999809265, 0, 0, 90 ) local marker = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) local marker2 = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) function moveGate(psource) local Deadusergroup = getAccountName(getPlayerAccount(psource)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Bope")) then moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 9) setTimer(moveBack, 5000, 1) else passbase() end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 15.199999809265) end result error: Bad argument @ 'triggerClientEvent' [Expected string at argument 1, got nil]
HUNGRY:3 Posted June 29, 2015 Posted June 29, 2015 (edited) the problem is that you didn't add the event in client side like addEvent("senhadabase",true) addEventHandler("senhadabase",getRootElement(),YourfunctionName) Edited June 29, 2015 by Guest
Arthur3989 Posted June 29, 2015 Author Posted June 29, 2015 on client.lua is set: function Senhadoportaobope() PassBope = guiCreateWindow(308, 52, 261, 94, "Senha da Bope", false) guiWindowSetSizable(PassBope, false) Senha = guiCreateEdit(52, 29, 160, 21, "", false, PassBope) OKbtn = guiCreateButton(30, 63, 71, 21, "OK", false, PassBope) guiSetProperty(OKbtn, "NormalTextColour", "FF17FF00") cancelarbtn = guiCreateButton(161, 63, 71, 21, "Cancelar", false, PassBope) guiSetProperty(cancelarbtn, "NormalTextColour", "FFFF0000") showCursor(true) addEventHandler("onClientGUIClick", OKbtn, testedesenha, false) addEventHandler("onClientGUIClick", cancelarbtn, fecharsenha, false) end addEvent("senhadabase", true) addEventHandler("senhadabase", getRootElement(), Senhadoportaobope) I would advise if I put: AddEventHandler ("onMarkerHit" marker, passbase) it works, only that no longer exits the function that I want would be to open a GUI if not BOPE group
tuaos Posted June 29, 2015 Posted June 29, 2015 use this in server-side!.. local gate = createObject( 980, 1541.0999755859, -1627.6999511719, 15.199999809265, 0, 0, 90 ) local marker = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) local marker2 = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) function moveGate(psource) local Deadusergroup = getAccountName(getPlayerAccount(psource)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Bope")) then moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 9) setTimer(moveBack, 5000, 1) else triggerClientEvent(psource, "senhadabase", psource) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 15.199999809265) end
Arthur3989 Posted June 29, 2015 Author Posted June 29, 2015 when entering the marker it says this in the console: [29/06/2015 14:39:21] ERROR: Base / server.lua: 104: attempt to place concatenate 'Deadusergroup' (a boolean value) [29/06/2015 14:39:23] ERROR: Base / server.lua: 108: attempt to place call 'pSource' (the value userdata)
tuaos Posted June 29, 2015 Posted June 29, 2015 when entering the marker it says this in the console:[29/06/2015 14:39:21] ERROR: Base / server.lua: 104: attempt to place concatenate 'Deadusergroup' (a boolean value) [29/06/2015 14:39:23] ERROR: Base / server.lua: 108: attempt to place call 'pSource' (the value userdata) Is Bope added in acl-Group? If not you will get error.
Arthur3989 Posted June 29, 2015 Author Posted June 29, 2015 tuaos yes added in acl-Group... I am create group Bope and i am add object resource.Base in Admin group
tuaos Posted June 29, 2015 Posted June 29, 2015 tuaos yes added in acl-Group... I am create group Bope and i am add object resource.Base in Admin group Is it working?
tuaos Posted June 29, 2015 Posted June 29, 2015 code stolen/leakedLocked topic What or How do you mean it? And even if this code is stolen/locked, its very easy code!
Arthur3989 Posted June 29, 2015 Author Posted June 29, 2015 this code I'm working on three days ... I am new to it even more scripts so it does not show the GUI
tuaos Posted June 30, 2015 Posted June 30, 2015 this code I'm working on three days ... I am new to it even more scripts so it does not show the GUI I replaced Bope with admin group.. and it works... local gate = createObject( 980, 1541.0999755859, -1627.6999511719, 15.199999809265, 0, 0, 90 ) local marker = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) local marker2 = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) function moveGate(psource) local Deadusergroup = getAccountName(getPlayerAccount(psource)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Admin")) then moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 9) setTimer(moveBack, 5000, 1) else triggerClientEvent(psource, "senhadabase", psource) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack() moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 15.199999809265) end So, the problem is either you didn't create group in acl for "Bope"
Arthur3989 Posted June 30, 2015 Author Posted June 30, 2015 WARNING: BaseBope/menu.lua:118: Bad argument @ 'getAccountName' [Expected account at argument 1, got boolean] ERROR: BaseBope/menu.lua:119: attempt to concatenate local 'Deadusergroup' (a boolean value) It is to pop up a GUI that prompts for the password to become member of the group Bope Server.lua function baseloged() if isObjectInACLGroup ( "user." .. getAccountName(getPlayerAccount(source)), aclGetGroup ( "Bope" ) ) then cancelEvent() else local accountName = getAccountName(getPlayerAccount(source)) aclGroupAddObject (aclGetGroup("Bope"), "user."..accountName) end end ----------------------------------------------------------------------------------------------- local gate = createObject( 980, 1541.0999755859, -1627.6999511719, 15.199999809265, 0, 0, 90 ) local marker = createMarker(1541.49, -1627.82, 13.38, "cylinder", 10, 255, 255, 255, 0) function moveGate(psource) local Deadusergroup = getAccountName(getPlayerAccount(psource)) if isObjectInACLGroup("user."..Deadusergroup, aclGetGroup("Bope")) then moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 9) else triggerClientEvent(psource, "senhadabase", psource()) end end addEventHandler("onMarkerHit", marker, moveGate) function moveBack(psource) local Deadusergroup2 = getAccountName(getPlayerAccount(psource)) if isObjectInACLGroup("user."..Deadusergroup2, aclGetGroup("Bope")) then moveObject(gate, 980, 1541.0999755859, -1627.6999511719, 15.199999809265) end end addEventHandler("onMarkerLeave", marker, moveBack) Client.lua function Senhadoportaobope() PassBope = guiCreateWindow(308, 52, 261, 94, "Senha da Bope", false) guiWindowSetSizable(PassBope, false) Senha = guiCreateEdit(52, 29, 160, 21, "", false, PassBope) OKbtn = guiCreateButton(30, 63, 71, 21, "OK", false, PassBope) guiSetProperty(OKbtn, "NormalTextColour", "FF17FF00") cancelarbtn = guiCreateButton(161, 63, 71, 21, "Cancelar", false, PassBope) guiSetProperty(cancelarbtn, "NormalTextColour", "FFFF0000") showCursor(true) addEventHandler("onClientGUIClick", OKbtn, testedesenha, false) addEventHandler("onClientGUIClick", cancelarbtn, fecharsenha, false) end addEvent("senhadabase", true) addEventHandler("senhadabase", getRootElement(), Senhadoportaobope) senhaofbasebope = "1234567" function testedesenha() local pass = guiGetText(Senha) if (pass == senhaofbasebope) then triggerServerEvent ( "baseloged", getLocalPlayer() ) end end function fecharsenha() showCursor(false) guiSetVisible (PassBope, not guiGetVisible ( PassBope ) ) end
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