iFoReX Posted April 8, 2012 Share Posted April 8, 2012 I cant find error in it script in the debugging say = have error in 158 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(214,198,427,231,"GUI Cambiar Pass",false) GUIEditor_Label[1] = guiCreateLabel(29,54,103,24,"Vieja Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0, 0, 190) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(137,51,179,26,"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(29,101,103,24,"Nueva Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,190) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(137,92,179,26,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Image[1] = guiCreateStaticImage(27,178,94,42,"images/BAT.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(126,175,82,45,"images/shruk.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(324,91,91,35,"Aceptar",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[1],false) GUIEditor_Button[2] = guiCreateButton(325,49,74,35,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Checkbox[1] = guiCreateCheckBox(30,150,359,20,"Acepto Las Condiciones y Terminos de Uso de este Servidor",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[1],"default-small") GUIEditor_Label[3] = guiCreateLabel(29,54,103,24,"Old Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,190) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(29,101,103,24,"New Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],0,0,190) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(325,49,74,35,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(324,91,91,35,"Accept",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[4],false) GUIEditor_Checkbox[2] = guiCreateCheckBox(30,150,359,20,"I accept the conditions and terms of use of this server",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[2],"default-small") GUIEditor_Label[5] = guiCreateLabel(219,181,198,24,"GUI CopyRight 2012 (c) by ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255, 255, 0) guiSetFont(GUIEditor_Label[5],"default-bold-small") guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Image[1] ) then guiSetVisible ( GUIEditor_Label[1], true ) guiSetVisible ( GUIEditor_Label[2], true ) guiSetVisible ( GUIEditor_Label[3], false ) guiSetVisible ( GUIEditor_Label[4], false ) guiSetVisible ( GUIEditor_Checkbox[1], true ) guiSetVisible ( GUIEditor_Checkbox[2], false ) guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) guiSetVisible ( GUIEditor_Button[3], false ) guiSetVisible ( GUIEditor_Button[4], false ) elseif ( source == GUIEditor_Image[2] ) then guiSetVisible ( GUIEditor_Label[3], true ) guiSetVisible ( GUIEditor_Label[4], true ) guiSetVisible ( GUIEditor_Label[1], false ) guiSetVisible ( GUIEditor_Label[2], false ) guiSetVisible ( GUIEditor_Checkbox[2], true ) guiSetVisible ( GUIEditor_Checkbox[1], false ) guiSetVisible ( GUIEditor_Button[3], true ) guiSetVisible ( GUIEditor_Button[4], true ) guiSetVisible ( GUIEditor_Button[1], false ) guiSetVisible ( GUIEditor_Button[2], false ) elseif ( source == GUIEditor_Button[2] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) elseif ( source == GUIEditor_Checkbox[1] ) then guiSetEnabled ( GUIEditor_Button[1], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Checkbox[2] ) then guiSetEnabled ( GUIEditor_Button[4], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Button[3] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) end end ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end addEventHandler ("onClientMarkerHit", changepassmarket, markerHit) addEventHandler ( "onClientPlayerDamage", root, function ( ) if ( isElementWithinMarker ( localPlayer, changepassmarket ) ) then setElementHealth ( localPlayer, 100 ) end end ) function clientSubmitChangepw(button, state) if button == "left" and state == "up" then local oldpassword = guiGetText(GUIEditor_Edit[1]) local newpassword = guiGetText(GUIEditor_Edit[2]) if oldpassword and newpassword then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, oldpassword, newpassword) else outputChatBox("Pon Tu vieja Contraseña y Tu Nueva Contraseña.") end end end addEventHandler( "onClientGUIClick", GUIEditor_Button[1], clientSubmitChangepw, false) function offPlayerChangeNick () cancelEvent () -- stop the event from occuring end addEventHandler ( "onPlayerChangeNick", root, offPlayerChangeNick ) -- What is "huntedPlayer"? ------------------------------------- --La GUI De Activacion---- GUI = guiCreateWindow(0.2387,0.2317,0.5375,0.2533,"GUI Cambiar Passwords",true) guiWindowSetMovable(GUI, false) guiWindowSetSizable(GUI, false) boton = guiCreateButton(9,29,153,41,"Abrir Tienda",false,GUI) guiSetFont(GUIEditor_Button[1],"default-bold-small") boton2 = guiCreateButton(264,29,153,41,"Cerrar Tienda",false,GUI) guiSetFont(GUIEditor_Button[2],"default-bold-small") label = guiCreateLabel(9,76,415,26,"--------------------------------------------------------------------------------",false,GUI) guiSetFont(GUIEditor_Label[1],"default-bold-small") boton3 = guiCreateButton(261,101,160,42,"Cancelar",false,GUI) guiSetVisible(GUI, false) showCursor(false) function losBotones() if (source == boton) then changepassmarket = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) blip = createBlipAttachedTo(changepassmarket, 35) elseif (source == boton2) then if isElement(changepassmarket) then destroyElement(changepassmarket) if isElement(blip) then destroyElement(blip) changepassmarket2 = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) blip = createBlipAttachedTo(changepassmarket2, 35) elseif (source == boton3) then guiSetVisible(GUI, false) showCursor(false) end end addEventHandler ( "onClientGUIClick", losBotones ) function laGUI() local accountName = getAccountName(account) if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "Admin" ) ) then guiSetVisible(GUI, true) showCursor(true) end end end bindKey("F6","down", laGUI) Link to comment
Guest Guest4401 Posted April 8, 2012 Share Posted April 8, 2012 Please recheck the 'losBotones' function. You got two 'if's in boton2 (line : 139 & 140) and you forgot to end it. The function remains incomplete, and that's why error shows at the last line. EDIT : in function laGUI, you have an extra 'end'. Remove that as well. Link to comment
iFoReX Posted April 8, 2012 Author Share Posted April 8, 2012 I remove and I have the problem in it line Link to comment
Cadu12 Posted April 8, 2012 Share Posted April 8, 2012 You are using client-side and server-side. isObjectInACLGroup, getAccountName and aclGetGroup is only server-side. Link to comment
iFoReX Posted April 8, 2012 Author Share Posted April 8, 2012 ? GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(214,198,427,231,"GUI Cambiar Pass",false) GUIEditor_Label[1] = guiCreateLabel(29,54,103,24,"Vieja Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0, 0, 190) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(137,51,179,26,"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(29,101,103,24,"Nueva Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,190) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(137,92,179,26,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Image[1] = guiCreateStaticImage(27,178,94,42,"images/BAT.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(126,175,82,45,"images/shruk.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(324,91,91,35,"Aceptar",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[1],false) GUIEditor_Button[2] = guiCreateButton(325,49,74,35,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Checkbox[1] = guiCreateCheckBox(30,150,359,20,"Acepto Las Condiciones y Terminos de Uso de este Servidor",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[1],"default-small") GUIEditor_Label[3] = guiCreateLabel(29,54,103,24,"Old Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,190) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(29,101,103,24,"New Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],0,0,190) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(325,49,74,35,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(324,91,91,35,"Accept",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[4],false) GUIEditor_Checkbox[2] = guiCreateCheckBox(30,150,359,20,"I accept the conditions and terms of use of this server",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[2],"default-small") GUIEditor_Label[5] = guiCreateLabel(219,181,198,24,"GUI CopyRight 2012 (c) by ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255, 255, 0) guiSetFont(GUIEditor_Label[5],"default-bold-small") guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Image[1] ) then guiSetVisible ( GUIEditor_Label[1], true ) guiSetVisible ( GUIEditor_Label[2], true ) guiSetVisible ( GUIEditor_Label[3], false ) guiSetVisible ( GUIEditor_Label[4], false ) guiSetVisible ( GUIEditor_Checkbox[1], true ) guiSetVisible ( GUIEditor_Checkbox[2], false ) guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) guiSetVisible ( GUIEditor_Button[3], false ) guiSetVisible ( GUIEditor_Button[4], false ) elseif ( source == GUIEditor_Image[2] ) then guiSetVisible ( GUIEditor_Label[3], true ) guiSetVisible ( GUIEditor_Label[4], true ) guiSetVisible ( GUIEditor_Label[1], false ) guiSetVisible ( GUIEditor_Label[2], false ) guiSetVisible ( GUIEditor_Checkbox[2], true ) guiSetVisible ( GUIEditor_Checkbox[1], false ) guiSetVisible ( GUIEditor_Button[3], true ) guiSetVisible ( GUIEditor_Button[4], true ) guiSetVisible ( GUIEditor_Button[1], false ) guiSetVisible ( GUIEditor_Button[2], false ) elseif ( source == GUIEditor_Button[2] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) elseif ( source == GUIEditor_Checkbox[1] ) then guiSetEnabled ( GUIEditor_Button[1], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Checkbox[2] ) then guiSetEnabled ( GUIEditor_Button[4], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Button[3] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) end end ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end addEventHandler ("onClientMarkerHit", changepassmarket, markerHit) addEventHandler ( "onClientPlayerDamage", root, function ( ) if ( isElementWithinMarker ( localPlayer, changepassmarket ) ) then setElementHealth ( localPlayer, 100 ) end end ) function clientSubmitChangepw(button, state) if button == "left" and state == "up" then local oldpassword = guiGetText(GUIEditor_Edit[1]) local newpassword = guiGetText(GUIEditor_Edit[2]) if oldpassword and newpassword then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, oldpassword, newpassword) else outputChatBox("Pon Tu vieja Contraseña y Tu Nueva Contraseña.") end end end addEventHandler( "onClientGUIClick", GUIEditor_Button[1], clientSubmitChangepw, false) function offPlayerChangeNick () cancelEvent () -- stop the event from occuring end addEventHandler ( "onPlayerChangeNick", root, offPlayerChangeNick ) -- What is "huntedPlayer"? ------------------------------------- --La GUI De Activacion---- GUI = guiCreateWindow(0.2387,0.2317,0.5375,0.2533,"GUI Cambiar Passwords",true) guiWindowSetMovable(GUI, false) guiWindowSetSizable(GUI, false) boton = guiCreateButton(9,29,153,41,"Abrir Tienda",false,GUI) guiSetFont(GUIEditor_Button[1],"default-bold-small") boton2 = guiCreateButton(264,29,153,41,"Cerrar Tienda",false,GUI) guiSetFont(GUIEditor_Button[2],"default-bold-small") label = guiCreateLabel(9,76,415,26,"--------------------------------------------------------------------------------",false,GUI) guiSetFont(GUIEditor_Label[1],"default-bold-small") boton3 = guiCreateButton(261,101,160,42,"Cancelar",false,GUI) guiSetVisible(GUI, false) showCursor(false) function losBotones() if (source == boton) then changepassmarket = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) blip = createBlipAttachedTo(changepassmarket, 35) elseif (source == boton2) then if isElement(changepassmarket) then destroyElement(changepassmarket) elseif isElement(blip) then destroyElement(blip) changepassmarket2 = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) blip = createBlipAttachedTo(changepassmarket2, 35) elseif (source == boton3) then guiSetVisible(GUI, false) showCursor(false) end end addEventHandler ( "onClientGUIClick", losBotones ) function lagui() triggerServerEvent ( "ACL",getLocalPlayer()) guiSetVisible(GUI, true) showCursor(true) end end bindKey("F6","down", lagui) function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("Tu Necesitas Loggearte para Cambiar la Contraseña/You must be logged in to change your password.", player) return end local accountName = getAccountName ( account ) local password_check = getAccount(accountName, oldpassword) if (password_check ~= false) then if (string.len(newpassword) >= 3) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Tu Nueva Contraseña Debe ser de menos de 10 caracteres/Your new password must be at least 10 characters long!", player) end else outputChatBox("Vieja Contraseña Invalida/Old Password Invalid.", player) end end end addEvent("submitChangepw", true) addEventHandler("submitChangepw", root, passwordHandler) function offPlayerChangeNick () cancelEvent () -- stop the event from occuring end addEventHandler ( "onPlayerChangeNick", root, offPlayerChangeNick ) -- What is "huntedPlayer"? function ACLF() local accountName = getAccountName(account) if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "Admin" ) ) then end end addEvent("ACL", true) addEventHandler("ACL", localPlayer, ACLF) Link to comment
Jaysds1 Posted April 8, 2012 Share Posted April 8, 2012 it still can't work? May I ask, What is this script for? Link to comment
iFoReX Posted April 8, 2012 Author Share Posted April 8, 2012 is my shop of change passwords but I want add a GUI for put Open and Put Close, the "GUI" Link to comment
Jaysds1 Posted April 8, 2012 Share Posted April 8, 2012 is my shop of change passwords but I want add a GUI for put Open and Put Close, the "GUI" I'll try making it and fixing your code tomorrow. Link to comment
drk Posted April 8, 2012 Share Posted April 8, 2012 GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(214,198,427,231,"GUI Cambiar Pass",false) GUIEditor_Label[1] = guiCreateLabel(29,54,103,24,"Vieja Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0, 0, 190) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(137,51,179,26,"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(29,101,103,24,"Nueva Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,190) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(137,92,179,26,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Image[1] = guiCreateStaticImage(27,178,94,42,"images/BAT.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(126,175,82,45,"images/shruk.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(324,91,91,35,"Aceptar",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[1],false) GUIEditor_Button[2] = guiCreateButton(325,49,74,35,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Checkbox[1] = guiCreateCheckBox(30,150,359,20,"Acepto Las Condiciones y Terminos de Uso de este Servidor",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[1],"default-small") GUIEditor_Label[3] = guiCreateLabel(29,54,103,24,"Old Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,190) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(29,101,103,24,"New Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],0,0,190) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(325,49,74,35,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(324,91,91,35,"Accept",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[4],false) GUIEditor_Checkbox[2] = guiCreateCheckBox(30,150,359,20,"I accept the conditions and terms of use of this server",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[2],"default-small") GUIEditor_Label[5] = guiCreateLabel(219,181,198,24,"GUI CopyRight 2012 (c) by ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255, 255, 0) guiSetFont(GUIEditor_Label[5],"default-bold-small") guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Image[1] ) then guiSetVisible ( GUIEditor_Label[1], true ) guiSetVisible ( GUIEditor_Label[2], true ) guiSetVisible ( GUIEditor_Label[3], false ) guiSetVisible ( GUIEditor_Label[4], false ) guiSetVisible ( GUIEditor_Checkbox[1], true ) guiSetVisible ( GUIEditor_Checkbox[2], false ) guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) guiSetVisible ( GUIEditor_Button[3], false ) guiSetVisible ( GUIEditor_Button[4], false ) elseif ( source == GUIEditor_Image[2] ) then guiSetVisible ( GUIEditor_Label[3], true ) guiSetVisible ( GUIEditor_Label[4], true ) guiSetVisible ( GUIEditor_Label[1], false ) guiSetVisible ( GUIEditor_Label[2], false ) guiSetVisible ( GUIEditor_Checkbox[2], true ) guiSetVisible ( GUIEditor_Checkbox[1], false ) guiSetVisible ( GUIEditor_Button[3], true ) guiSetVisible ( GUIEditor_Button[4], true ) guiSetVisible ( GUIEditor_Button[1], false ) guiSetVisible ( GUIEditor_Button[2], false ) elseif ( source == GUIEditor_Button[2] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) elseif ( source == GUIEditor_Checkbox[1] ) then guiSetEnabled ( GUIEditor_Button[1], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Checkbox[2] ) then guiSetEnabled ( GUIEditor_Button[4], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Button[3] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) end end ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end addEventHandler ("onClientMarkerHit", changepassmarket, markerHit) addEventHandler ( "onClientPlayerDamage", root, function ( ) if ( isElementWithinMarker ( source, changepassmarket ) ) then setElementHealth ( source, 100 ) end end ) function clientSubmitChangepw(button, state) if button == "left" and state == "up" then local oldpassword = guiGetText(GUIEditor_Edit[1]) local newpassword = guiGetText(GUIEditor_Edit[2]) if oldpassword and newpassword then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, oldpassword, newpassword) else outputChatBox("Pon Tu vieja Contraseña y Tu Nueva Contraseña.") end end end addEventHandler( "onClientGUIClick", GUIEditor_Button[1], clientSubmitChangepw, false) function offPlayerChangeNick () cancelEvent () -- stop the event from occuring end addEventHandler ( "onPlayerChangeNick", root, offPlayerChangeNick ) -- What is "huntedPlayer"? ------------------------------------- --La GUI De Activacion---- GUI = guiCreateWindow(0.2387,0.2317,0.5375,0.2533,"GUI Cambiar Passwords",true) guiWindowSetMovable(GUI, false) guiWindowSetSizable(GUI, false) boton = guiCreateButton(9,29,153,41,"Abrir Tienda",false,GUI) guiSetFont(GUIEditor_Button[1],"default-bold-small") boton2 = guiCreateButton(264,29,153,41,"Cerrar Tienda",false,GUI) guiSetFont(GUIEditor_Button[2],"default-bold-small") label = guiCreateLabel(9,76,415,26,"--------------------------------------------------------------------------------",false,GUI) guiSetFont(GUIEditor_Label[1],"default-bold-small") boton3 = guiCreateButton(261,101,160,42,"Cancelar",false,GUI) guiSetVisible(GUI, false) function losBotones() if (source == boton) then changepassmarket = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) blip = createBlipAttachedTo(changepassmarket, 35) elseif (source == boton2) then if isElement ( changepassmarket ) then destroyElement(changepassmarket) end elseif isElement(blip) then destroyElement(blip) changepassmarket2 = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) blip = createBlipAttachedTo(changepassmarket2, 35) elseif (source == boton3) then guiSetVisible(GUI, false) showCursor(false) end end addEventHandler ( "onClientGUIClick", root, losBotones ) function lagui() triggerServerEvent ( "ACL",localPlayer) guiSetVisible(GUI, true) showCursor(true) end bindKey("F6","down", lagui) function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("Tu Necesitas Loggearte para Cambiar la Contraseña/You must be logged in to change your password.", player) return end local accountName = getAccountName ( account ) local password_check = getAccount(accountName, oldpassword) if (password_check ~= false) then if (string.len(newpassword) >= 3) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Tu Nueva Contraseña Debe ser de menos de 10 caracteres/Your new password must be at least 10 characters long!", player) end else outputChatBox("Vieja Contraseña Invalida/Old Password Invalid.", player) end end end addEvent("submitChangepw", true) addEventHandler("submitChangepw", root, passwordHandler) function ACLF() local accountName = getAccountName( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "Admin" ) ) then -- something here, no?? end end addEvent("ACL", true) addEventHandler("ACL", root, ACLF) You have a lot of wrong things. Link to comment
iFoReX Posted April 8, 2012 Author Share Posted April 8, 2012 draken all peoples can open my window Link to comment
Castillo Posted April 8, 2012 Share Posted April 8, 2012 -- client side: GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_Checkbox = {} GUIEditor_Label = {} GUIEditor_Edit = {} GUIEditor_Image = {} GUIEditor_Window[1] = guiCreateWindow(214,198,427,231,"GUI Cambiar Pass",false) GUIEditor_Label[1] = guiCreateLabel(29,54,103,24,"Vieja Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[1],0, 0, 190) guiSetFont(GUIEditor_Label[1],"default-bold-small") GUIEditor_Edit[1] = guiCreateEdit(137,51,179,26,"",false,GUIEditor_Window[1]) GUIEditor_Label[2] = guiCreateLabel(29,101,103,24,"Nueva Contraseña ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[2],0,0,190) guiSetFont(GUIEditor_Label[2],"default-bold-small") GUIEditor_Edit[2] = guiCreateEdit(137,92,179,26,"",false,GUIEditor_Window[1]) guiEditSetMaxLength(GUIEditor_Edit[2],10) GUIEditor_Image[1] = guiCreateStaticImage(27,178,94,42,"images/BAT.png",false,GUIEditor_Window[1]) GUIEditor_Image[2] = guiCreateStaticImage(126,175,82,45,"images/shruk.png",false,GUIEditor_Window[1]) GUIEditor_Button[1] = guiCreateButton(324,91,91,35,"Aceptar",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[1],false) GUIEditor_Button[2] = guiCreateButton(325,49,74,35,"Cancelar",false,GUIEditor_Window[1]) GUIEditor_Checkbox[1] = guiCreateCheckBox(30,150,359,20,"Acepto Las Condiciones y Terminos de Uso de este Servidor",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[1],"default-small") GUIEditor_Label[3] = guiCreateLabel(29,54,103,24,"Old Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[3],0,0,190) guiSetFont(GUIEditor_Label[3],"default-bold-small") GUIEditor_Label[4] = guiCreateLabel(29,101,103,24,"New Password ",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[4],0,0,190) guiSetFont(GUIEditor_Label[4],"default-bold-small") GUIEditor_Button[3] = guiCreateButton(325,49,74,35,"Cancel",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(324,91,91,35,"Accept",false,GUIEditor_Window[1]) guiSetEnabled(GUIEditor_Button[4],false) GUIEditor_Checkbox[2] = guiCreateCheckBox(30,150,359,20,"I accept the conditions and terms of use of this server",false,false,GUIEditor_Window[1]) guiSetFont(GUIEditor_Checkbox[2],"default-small") GUIEditor_Label[5] = guiCreateLabel(219,181,198,24,"GUI CopyRight 2012 (c) by ElMota",false,GUIEditor_Window[1]) guiLabelSetColor(GUIEditor_Label[5],255, 255, 0) guiSetFont(GUIEditor_Label[5],"default-bold-small") guiSetVisible ( GUIEditor_Window[1], false ) addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == GUIEditor_Image[1] ) then guiSetVisible ( GUIEditor_Label[1], true ) guiSetVisible ( GUIEditor_Label[2], true ) guiSetVisible ( GUIEditor_Label[3], false ) guiSetVisible ( GUIEditor_Label[4], false ) guiSetVisible ( GUIEditor_Checkbox[1], true ) guiSetVisible ( GUIEditor_Checkbox[2], false ) guiSetVisible ( GUIEditor_Button[1], true ) guiSetVisible ( GUIEditor_Button[2], true ) guiSetVisible ( GUIEditor_Button[3], false ) guiSetVisible ( GUIEditor_Button[4], false ) elseif ( source == GUIEditor_Image[2] ) then guiSetVisible ( GUIEditor_Label[3], true ) guiSetVisible ( GUIEditor_Label[4], true ) guiSetVisible ( GUIEditor_Label[1], false ) guiSetVisible ( GUIEditor_Label[2], false ) guiSetVisible ( GUIEditor_Checkbox[2], true ) guiSetVisible ( GUIEditor_Checkbox[1], false ) guiSetVisible ( GUIEditor_Button[3], true ) guiSetVisible ( GUIEditor_Button[4], true ) guiSetVisible ( GUIEditor_Button[1], false ) guiSetVisible ( GUIEditor_Button[2], false ) elseif ( source == GUIEditor_Button[2] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) elseif ( source == GUIEditor_Checkbox[1] ) then guiSetEnabled ( GUIEditor_Button[1], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Checkbox[2] ) then guiSetEnabled ( GUIEditor_Button[4], guiCheckBoxGetSelected ( source ) ) elseif ( source == GUIEditor_Button[3] ) then guiSetVisible ( GUIEditor_Window[1], false ) showCursor(false) guiSetInputEnabled(false) end end ) function markerHit (hitPlayer) if ( hitPlayer == localPlayer ) then guiSetVisible (GUIEditor_Window[1], true) showCursor (true) end end addEventHandler ("onClientMarkerHit", changepassmarket, markerHit) addEventHandler ( "onClientPlayerDamage", root, function ( ) if ( isElementWithinMarker ( source, changepassmarket ) ) then setElementHealth ( source, 100 ) end end ) function clientSubmitChangepw(button, state) if button == "left" and state == "up" then local oldpassword = guiGetText(GUIEditor_Edit[1]) local newpassword = guiGetText(GUIEditor_Edit[2]) if oldpassword and newpassword then triggerServerEvent("submitChangepw", getRootElement(), localPlayer, oldpassword, newpassword) else outputChatBox("Pon Tu vieja Contraseña y Tu Nueva Contraseña.") end end end addEventHandler( "onClientGUIClick", GUIEditor_Button[1], clientSubmitChangepw, false) function offPlayerChangeNick () cancelEvent () -- stop the event from occuring end addEventHandler ( "onPlayerChangeNick", root, offPlayerChangeNick ) -- What is "huntedPlayer"? ------------------------------------- --La GUI De Activacion---- GUI = guiCreateWindow(0.2387,0.2317,0.5375,0.2533,"GUI Cambiar Passwords",true) guiWindowSetMovable(GUI, false) guiWindowSetSizable(GUI, false) boton = guiCreateButton(9,29,153,41,"Abrir Tienda",false,GUI) guiSetFont(GUIEditor_Button[1],"default-bold-small") boton2 = guiCreateButton(264,29,153,41,"Cerrar Tienda",false,GUI) guiSetFont(GUIEditor_Button[2],"default-bold-small") label = guiCreateLabel(9,76,415,26,"--------------------------------------------------------------------------------",false,GUI) guiSetFont(GUIEditor_Label[1],"default-bold-small") boton3 = guiCreateButton(261,101,160,42,"Cancelar",false,GUI) guiSetVisible(GUI, false) function losBotones() if (source == boton) then changepassmarket = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) blip = createBlipAttachedTo(changepassmarket, 35) elseif (source == boton2) then if isElement ( changepassmarket ) then destroyElement(changepassmarket) end elseif isElement(blip) then destroyElement(blip) changepassmarket2 = createMarker (273.19537, -158.01585, 0, "cylinder", 3, 255, 0, 0, 100) blip = createBlipAttachedTo(changepassmarket2, 35) elseif (source == boton3) then guiSetVisible(GUI, false) showCursor(false) end end addEventHandler ( "onClientGUIClick", root, losBotones ) function lagui() guiSetVisible(GUI, true) showCursor(true) end addEvent ( "showGUI", true ) addEventHandler ( "showGUI", root, lagui ) -- server side: addEventHandler ( "onPlayerJoin", root, function ( ) bindKey ( source, "F6", "down", showGUI ) end ) addEventHandler ( "onResourceStart", resourceRoot, function ( ) for index, player in ipairs ( getElementsByType ( "player" ) ) do bindKey ( player, "F6", "down", showGUI ) end end ) function passwordHandler(player, oldpassword, newpassword) local account = getPlayerAccount(player) if (account) then if (isGuestAccount(account)) then outputChatBox("Tu Necesitas Loggearte para Cambiar la Contraseña/You must be logged in to change your password.", player) return end local accountName = getAccountName ( account ) local password_check = getAccount(accountName, oldpassword) if (password_check ~= false) then if (string.len(newpassword) >= 3) then setAccountPassword(account, newpassword) triggerClientEvent(player, "hidePasswordWindow", getRootElement()) else outputChatBox("Tu Nueva Contraseña Debe ser de menos de 10 caracteres/Your new password must be at least 10 characters long!", player) end else outputChatBox("Vieja Contraseña Invalida/Old Password Invalid.", player) end end end addEvent("submitChangepw", true) addEventHandler("submitChangepw", root, passwordHandler) function showGUI ( thePlayer ) local accountName = getAccountName( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user.".. accountName, aclGetGroup ( "Admin" ) ) then triggerClientEvent ( thePlayer, "showGUI", thePlayer ) end end 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