Spawn* Posted December 4, 2012 Share Posted December 4, 2012 addEventHandler("onClientGUIClick", rGUI_BtnCat, EventGUICat, false) function EventGUICat(button) -- some noob code if((callServerFunction("addAccount", Acct, Pass)) ~= false) then showCursor(false) guiSetVisible(rGUI_theBox, not guiGetVisible(rGUI_theBox)) guiSetVisible(rGUI_LbLCon, not guiGetVisible(rGUI_LbLCon)) guiSetVisible(rGUI_LbLSen, not guiGetVisible(rGUI_LbLSen)) guiSetVisible(rGUI_EdtCon, not guiGetVisible(rGUI_EdtCon)) guiSetVisible(rGUI_EdtSen, not guiGetVisible(rGUI_EdtSen)) guiSetVisible(rGUI_BtnLog, not guiGetVisible(rGUI_BtnLog)) guiSetVisible(rGUI_BtnCat, not guiGetVisible(rGUI_BtnCat)) guiSetVisible(rGUI_ImgGUI, not guiGetVisible(rGUI_ImgGUI)) else outputChatBox("Essa conta já existe.", 255, 0, 0) return end end The problem is Access denied @ addAccount in console. Help me please Link to comment
Castillo Posted December 4, 2012 Share Posted December 4, 2012 Add the resource to the ACL group: "Admin" at "acl.xml". Link to comment
Spawn* Posted December 4, 2012 Author Share Posted December 4, 2012 How? You could do an example for me? I'm a beginner and don't understand much of the administration system Link to comment
Castillo Posted December 4, 2012 Share Posted December 4, 2012 "Admin"> "Moderator"> "SuperModerator"> "Admin"> "RPC"> "resource.admin"> "resource.webadmin"> That's the group, now you add it like this: "resource.resourceName"> Link to comment
Spawn* Posted December 4, 2012 Author Share Posted December 4, 2012 Sorry... I'm not understanding my file acl.xml is in: MTA San Andreas 1.3\servers\mods\deathmatch\acl.xml Ok... I add the lines: <group name="Admin"> <acl name="Moderator"></acl> <acl name="SuperModerator"></acl> <acl name="Admin"></acl> <acl name="RPC"></acl> <object name="resource.admin"></object> <object name="resource.webadmin"></object> <object name="resource.ORP_s"></object> -- here <object name="resource.ORP_c"></object> -- here but still giving that warning Link to comment
TwiX! Posted December 4, 2012 Share Posted December 4, 2012 what is your resource name? "resource.resourceName"> my resource name is EXAMPLE so "resource.EXAMPLE"> Link to comment
Spawn* Posted December 4, 2012 Author Share Posted December 4, 2012 exactly... my resource name is ORP_c and ORP_c HAHAHA Link to comment
TwiX! Posted December 4, 2012 Share Posted December 4, 2012 you need put only folderName or zipName Link to comment
Spawn* Posted December 4, 2012 Author Share Posted December 4, 2012 you need put only folderName or zipName Oh, sorry! I put the name of script and not the resource hahahaha I'll try Link to comment
Spawn* Posted December 4, 2012 Author Share Posted December 4, 2012 Right, this problem was resolved Now... the code is this: function EventGUICat(button) if button == "left" then local Acct = guiGetText(rGUI_EdtCon) local Pass = guiGetText(rGUI_EdtSen) if(#Acct == 0 or #Pass == 0) then outputChatBox("Digite um nome de Conta não registrado e sua respectiva Senha.", 255, 0, 0) return end if((#Acct ~= 0 and #Acct < 4) or (#Pass ~= 0 and #Pass < 4)) then outputChatBox("O nome de Conta e a Senha devem conter no mínimo 4 caracteres.", 255, 0, 0) return end if(callServerFunction("addAccount", Acct, Pass)) then outputChatBox("Registrado.", 255, 0, 0) showCursor(false) guiSetVisible(rGUI_theBox, not guiGetVisible(rGUI_theBox)) guiSetVisible(rGUI_LbLCon, not guiGetVisible(rGUI_LbLCon)) guiSetVisible(rGUI_LbLSen, not guiGetVisible(rGUI_LbLSen)) guiSetVisible(rGUI_EdtCon, not guiGetVisible(rGUI_EdtCon)) guiSetVisible(rGUI_EdtSen, not guiGetVisible(rGUI_EdtSen)) guiSetVisible(rGUI_BtnLog, not guiGetVisible(rGUI_BtnLog)) guiSetVisible(rGUI_BtnCat, not guiGetVisible(rGUI_BtnCat)) guiSetVisible(rGUI_ImgGUI, not guiGetVisible(rGUI_ImgGUI)) else if(callServerFunction("getAccount", Acct)) then outputChatBox("Conta já existente.", 255, 0, 0) else outputChatBox("Erro desconhecido.", 255, 0, 0) end end end but there is some error... the script is not loaded. This is already becoming too complicated Link to comment
Sparrow Posted December 4, 2012 Share Posted December 4, 2012 an "end' was missing function EventGUICat(button) if button == "left" then local Acct = guiGetText(rGUI_EdtCon) local Pass = guiGetText(rGUI_EdtSen) if(#Acct == 0 or #Pass == 0) then outputChatBox("Digite um nome de Conta não registrado e sua respectiva Senha.", 255, 0, 0) return end if((#Acct ~= 0 and #Acct < 4) or (#Pass ~= 0 and #Pass < 4)) then outputChatBox("O nome de Conta e a Senha devem conter no mínimo 4 caracteres.", 255, 0, 0) return end if(callServerFunction("addAccount", Acct, Pass)) then outputChatBox("Registrado.", 255, 0, 0) showCursor(false) guiSetVisible(rGUI_theBox, not guiGetVisible(rGUI_theBox)) guiSetVisible(rGUI_LbLCon, not guiGetVisible(rGUI_LbLCon)) guiSetVisible(rGUI_LbLSen, not guiGetVisible(rGUI_LbLSen)) guiSetVisible(rGUI_EdtCon, not guiGetVisible(rGUI_EdtCon)) guiSetVisible(rGUI_EdtSen, not guiGetVisible(rGUI_EdtSen)) guiSetVisible(rGUI_BtnLog, not guiGetVisible(rGUI_BtnLog)) guiSetVisible(rGUI_BtnCat, not guiGetVisible(rGUI_BtnCat)) guiSetVisible(rGUI_ImgGUI, not guiGetVisible(rGUI_ImgGUI)) else if(callServerFunction("getAccount", Acct)) then outputChatBox("Conta já existente.", 255, 0, 0) else outputChatBox("Erro desconhecido.", 255, 0, 0) end end end end Link to comment
Spawn* Posted December 4, 2012 Author Share Posted December 4, 2012 The code has not worked, only appeared the message "Erro desconhecido.". So I decided to do a test ... I took the command /register of the system administration and improvised to work on my script-client. RESULT: addCommandHandler ( "register2", function (command, arg1, arg2 ) local username = getPlayerName ( getLocalPlayer() ) local password = arg1 if ( arg2 ) then username = arg1 password = arg2 end if ( password ~= nil ) then if ( string.len ( password ) < 4 ) then outputChatBox ( "register: - Password should be at least 4 characters long", 255, 100, 70 ) elseif ( callServerFunction("addAccount", username, password ) ) then outputChatBox ( "You have successfully registered! Username: '"..username.."', Password: '"..password.."'(Remember it)", 255, 100, 70 ) outputServerLog ( "ADMIN: "..getPlayerName ( getLocalPlayer() ).." registered account '"..username.."' (IP: "..getPlayerIP(getLocalPlayer()).." Serial: "..getPlayerSerial(getLocalPlayer())..")" ) elseif ( callServerFunction("getAccount", username ) ) then outputChatBox ( "register: - Account with this name already exists.", 255, 100, 70 ) else outputChatBox ( "Unknown Error", 255, 100, 70 ) end else outputChatBox ( "register: - Syntax is 'register [] '", 255, 100, 70 ) end end ) The error was the same ... the only message displayed was "Unknown Error". Now instead of calling a native function with callServerFunction I'll create a function and call it, and inside it put addAccount. Sorry for my bad english. Please help me if you have suggestions 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