Jump to content

تصحيح كود


Recommended Posts

سلام عليكم ورحمه الله وبركاته

اما بعدد :-

زي ما شايفين بالموضوع الكود هو

  
GUIEditor = { 
    edit = {}, 
    button = {}, 
    staticimage = {}, 
    checkbox = {}, 
} 
  
onlogin = guiCreateButton(295, 422, 107, 41, "", false) 
guiSetAlpha(GUIEditor.button[1], 0.00) 
  
onregister = guiCreateButton(414, 422, 108, 41, "", false) 
guiSetAlpha(GUIEditor.button[2], 0.00) 
  
GUIEditor.button[3] = guiCreateButton(295, 469, 228, 41, "", false) 
guiSetAlpha(GUIEditor.button[3], 0.00) 
  
GUIEditor.checkbox[1] = guiCreateCheckBox(306, 354, 15, 15, "تذكرني", false, false) 
  
user = guiCreateEdit(20, 29, 208, 30, "",false) 
  
pass = guiCreateEdit(20, 100, 208, 30, "",false) 
  
GUIEditor.staticimage[1] = guiCreateStaticImage(286, 219, 250, 321, "S1.png", false) 
guiSetAlpha(GUIEditor.staticimage[1], 0.65) 
  
  
GUIEditor.staticimage[2] = guiCreateStaticImage(286, 176, 250, 33, "S1.png", false) 
guiSetAlpha(GUIEditor.staticimage[2], 0.64) 
  
  
    function login() 
        dxDrawText("Login - Register v.1", 330, 176, 483, 204, tocolor(255, 255, 255, 255), 1, "default", "left", "center", false, false, true, false, false) 
        dxDrawText(":اسم المستخدم ", 351, 219, 473, 238, tocolor(209, 178, 79, 255), 2, "default-bold", "left", "top", false, false, true, false, false) 
        dxDrawText(": كلمة المرور ", 350, 285, 463, 313, tocolor(209, 178, 79, 255), 2, "default", "left", "top", false, false, true, false, false) 
        dxDrawRectangle(296, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
        dxDrawRectangle(296, 470, 229, 41, tocolor(216, 189, 104, 255), true) 
        dxDrawLine(285, 219, 407, 248, tocolor(255, 255, 255, 255), 1, true) 
        dxDrawRectangle(416, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
        dxDrawLine(535, 219, 536, 540, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(285, 539, 536, 539, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 219, 537, 219, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 209, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 176, 537, 176, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(537, 176, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 176, 286, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawText("*سجل عشان تنحفظ ساعاتك", 293, 517, 511, 534, tocolor(199, 131, 1, 255), 1, "default-bold", "left", "top", true, false, true, false, false) 
        dxDrawText("تذكرني", 323, 353, 418, 373, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false, false) 
    end 
addEventHandler("onClientRender", root, login) 
  
    function login1() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, login1) 
     
    function login2() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, login2) 
     
    function Register1() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(47, 47, 51, 255), 2, "default", "left", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Register1) 
     
    function Register2() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(201, 0, 0, 255), 2, "default", "left", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Register2) 
  
    function Guest1() 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, true, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Guest1) 
     
    function Guest2) 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, true, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Guest2) 
     
     
     
removeEventHandler("onClientRender", root, login1) 
removeEventHandler("onClientRender", root, Register2) 
removeEventHandler("onClientRender", root, Guest2) 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  onlogin ) then 
        triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    elseif ( source ==  onregister ) then 
        triggerServerEvent("onregister",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    end 
end 
function Show() 
if source == GUIEditor.button[3] then 
  
removeEventHandler("onClientRender", root, login) 
    end 
end 
  
addEventHandler ("onClientGUIClick", root, Show) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == onlogin ) then 
   addEventHandler("onClientRender", root, login1) 
   removeEventHandler("onClientRender", root, login2) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == onlogin  ) then 
           removeEventHandler("onClientRender", root, login1) 
           addEventHandler("onClientRender", root, login2) 
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == onregister ) then 
   addEventHandler("onClientRender", root, Register2) 
   removeEventHandler("onClientRender", root, Register1) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == onregister  ) then 
           removeEventHandler("onClientRender", root, Register2) 
           addEventHandler("onClientRender", root, Register1) 
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == GUIEditor.button[3]  ) then 
   addEventHandler("onClientRender", root, Guest2) 
   removeEventHandler("onClientRender", root, Guest1) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == GUIEditor.button[3]  ) then 
           removeEventHandler("onClientRender", root, Guest2) 
           addEventHandler("onClientRender", root, Guest1) 
     end 
end ) 
  

يجيني بالديبوق

ERROR : Loading script failed Dx_Login/c.lua.;76'(' expected near ' )'

وسلام خير الختام :mrgreen::roll:

Link to comment

جرب

  
GUIEditor = { 
    edit = {}, 
    button = {}, 
    staticimage = {}, 
    checkbox = {}, 
} 
  
onlogin = guiCreateButton(295, 422, 107, 41, "", false) 
guiSetAlpha(GUIEditor.button[1], 0.00) 
  
onregister = guiCreateButton(414, 422, 108, 41, "", false) 
guiSetAlpha(GUIEditor.button[2], 0.00) 
  
GUIEditor.button[3] = guiCreateButton(295, 469, 228, 41, "", false) 
guiSetAlpha(GUIEditor.button[3], 0.00) 
  
GUIEditor.checkbox[1] = guiCreateCheckBox(306, 354, 15, 15, "تذكرني", false, false) 
  
user = guiCreateEdit(20, 29, 208, 30, "",false) 
  
pass = guiCreateEdit(20, 100, 208, 30, "",false) 
  
GUIEditor.staticimage[1] = guiCreateStaticImage(286, 219, 250, 321, "S1.png", false) 
guiSetAlpha(GUIEditor.staticimage[1], 0.65) 
  
  
GUIEditor.staticimage[2] = guiCreateStaticImage(286, 176, 250, 33, "S1.png", false) 
guiSetAlpha(GUIEditor.staticimage[2], 0.64) 
  
  
    function login() 
        dxDrawText("Login - Register v.1", 330, 176, 483, 204, tocolor(255, 255, 255, 255), 1, "default", "left", "center", false, false, true, false, false) 
        dxDrawText(":اسم المستخدم ", 351, 219, 473, 238, tocolor(209, 178, 79, 255), 2, "default-bold", "left", "top", false, false, true, false, false) 
        dxDrawText(": كلمة المرور ", 350, 285, 463, 313, tocolor(209, 178, 79, 255), 2, "default", "left", "top", false, false, true, false, false) 
        dxDrawRectangle(296, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
        dxDrawRectangle(296, 470, 229, 41, tocolor(216, 189, 104, 255), true) 
        dxDrawLine(285, 219, 407, 248, tocolor(255, 255, 255, 255), 1, true) 
        dxDrawRectangle(416, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
        dxDrawLine(535, 219, 536, 540, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(285, 539, 536, 539, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 219, 537, 219, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 209, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 176, 537, 176, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(537, 176, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 176, 286, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawText("*سجل عشان تنحفظ ساعاتك", 293, 517, 511, 534, tocolor(199, 131, 1, 255), 1, "default-bold", "left", "top", true, false, true, false, false) 
        dxDrawText("تذكرني", 323, 353, 418, 373, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false, false) 
    end 
addEventHandler("onClientRender", root, login) 
  
    function login1() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, login1) 
    
    function login2() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, login2) 
    
    function Register1() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(47, 47, 51, 255), 2, "default", "left", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Register1) 
    
    function Register2() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(201, 0, 0, 255), 2, "default", "left", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Register2) 
  
    function Guest1() 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, true, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Guest1) 
    
    function Guest2() 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, true, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Guest2) 
    
    
    
removeEventHandler("onClientRender", root, login1) 
removeEventHandler("onClientRender", root, Register2) 
removeEventHandler("onClientRender", root, Guest2) 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  onlogin ) then 
        triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    elseif ( source ==  onregister ) then 
        triggerServerEvent("onregister",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    end 
end 
function Show() 
if source == GUIEditor.button[3] then 
  
removeEventHandler("onClientRender", root, login) 
    end 
end 
  
addEventHandler ("onClientGUIClick", root, Show) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == onlogin ) then 
   addEventHandler("onClientRender", root, login1) 
   removeEventHandler("onClientRender", root, login2) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == onlogin  ) then 
           removeEventHandler("onClientRender", root, login1) 
           addEventHandler("onClientRender", root, login2) 
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == onregister ) then 
   addEventHandler("onClientRender", root, Register2) 
   removeEventHandler("onClientRender", root, Register1) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == onregister  ) then 
           removeEventHandler("onClientRender", root, Register2) 
           addEventHandler("onClientRender", root, Register1) 
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == GUIEditor.button[3]  ) then 
   addEventHandler("onClientRender", root, Guest2) 
   removeEventHandler("onClientRender", root, Guest1) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == GUIEditor.button[3]  ) then 
           removeEventHandler("onClientRender", root, Guest2) 
           addEventHandler("onClientRender", root, Guest1) 
     end 
end ) 
  
Link to comment

  
  
GUIEditor = { 
    edit = {}, 
    button = {}, 
    staticimage = {}, 
    checkbox = {}, 
} 
  
onlogin = guiCreateButton(295, 422, 107, 41, "", false) 
guiSetAlpha(GUIEditor.button[1], 0.00) 
  
onregister = guiCreateButton(414, 422, 108, 41, "", false) 
guiSetAlpha(GUIEditor.button[2], 0.00) 
  
GUIEditor.button[3] = guiCreateButton(295, 469, 228, 41, "", false) 
guiSetAlpha(GUIEditor.button[3], 0.00) 
  
GUIEditor.checkbox[1] = guiCreateCheckBox(306, 354, 15, 15, "تذكرني", false, false) 
  
user = guiCreateEdit(20, 29, 208, 30, "",false) 
  
pass = guiCreateEdit(20, 100, 208, 30, "",false) 
  
GUIEditor.staticimage[1] = guiCreateStaticImage(286, 219, 250, 321, "S1.png", false) 
guiSetAlpha(GUIEditor.staticimage[1], 0.65) 
  
  
GUIEditor.staticimage[2] = guiCreateStaticImage(286, 176, 250, 33, "S1.png", false) 
guiSetAlpha(GUIEditor.staticimage[2], 0.64) 
  
  
    function login() 
        dxDrawText("Login - Register v.1", 330, 176, 483, 204, tocolor(255, 255, 255, 255), 1, "default", "left", "center", false, false, true, false, false) 
        dxDrawText(":اسم المستخدم ", 351, 219, 473, 238, tocolor(209, 178, 79, 255), 2, "default-bold", "left", "top", false, false, true, false, false) 
        dxDrawText(": كلمة المرور ", 350, 285, 463, 313, tocolor(209, 178, 79, 255), 2, "default", "left", "top", false, false, true, false, false) 
        dxDrawRectangle(296, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
        dxDrawRectangle(296, 470, 229, 41, tocolor(216, 189, 104, 255), true) 
        dxDrawLine(285, 219, 407, 248, tocolor(255, 255, 255, 255), 1, true) 
        dxDrawRectangle(416, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
        dxDrawLine(535, 219, 536, 540, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(285, 539, 536, 539, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 219, 537, 219, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 209, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 176, 537, 176, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(537, 176, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 176, 286, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawText("*سجل عشان تنحفظ ساعاتك", 293, 517, 511, 534, tocolor(199, 131, 1, 255), 1, "default-bold", "left", "top", true, false, true, false, false) 
        dxDrawText("تذكرني", 323, 353, 418, 373, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false, false) 
    end 
addEventHandler("onClientRender", root, login) 
  
    function login1() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, login1) 
    
    function login2() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, login2) 
    
    function Register1() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(47, 47, 51, 255), 2, "default", "left", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Register1) 
    
    function Register2() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(201, 0, 0, 255), 2, "default", "left", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Register2) 
  
    function Guest1() 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, true, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Guest1) 
    
    function Guest2() 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, true, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Guest2) 
    
    
    
removeEventHandler("onClientRender", root, login1) 
removeEventHandler("onClientRender", root, Register2) 
removeEventHandler("onClientRender", root, Guest2) 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  onlogin ) then 
        triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    elseif ( source ==  onregister ) then 
        triggerServerEvent("onregister",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    end 
end ) 
function Show() 
if source == GUIEditor.button[3] then 
  
removeEventHandler("onClientRender", root, login) 
    end 
end 
  
addEventHandler ("onClientGUIClick", root, Show) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == onlogin ) then 
   addEventHandler("onClientRender", root, login1) 
   removeEventHandler("onClientRender", root, login2) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == onlogin  ) then 
           removeEventHandler("onClientRender", root, login1) 
           addEventHandler("onClientRender", root, login2) 
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == onregister ) then 
   addEventHandler("onClientRender", root, Register2) 
   removeEventHandler("onClientRender", root, Register1) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == onregister  ) then 
           removeEventHandler("onClientRender", root, Register2) 
           addEventHandler("onClientRender", root, Register1) 
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == GUIEditor.button[3]  ) then 
   addEventHandler("onClientRender", root, Guest2) 
   removeEventHandler("onClientRender", root, Guest1) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == GUIEditor.button[3]  ) then 
           removeEventHandler("onClientRender", root, Guest2) 
           addEventHandler("onClientRender", root, Guest1) 
     end 
end ) 
  
Link to comment

جرب#

:wink: ماجربته

-- #ClientSide 
onlogin = guiCreateButton(295, 422, 107, 41, "", false) 
onregister = guiCreateButton(414, 422, 108, 41, "", false) 
GUIEditor.button[3] = guiCreateButton(295, 469, 228, 41, "", false) 
GUIEditor.checkbox[1] = guiCreateCheckBox(306, 354, 15, 15, "تذكرني", false, false) 
user = guiCreateEdit(20, 29, 208, 30, "",false) 
pass = guiCreateEdit(20, 100, 208, 30, "",false) 
GUIEditor.staticimage[1] = guiCreateStaticImage(286, 219, 250, 321, "S1.png", false) 
GUIEditor.staticimage[2] = guiCreateStaticImage(286, 176, 250, 33, "S1.png", false) 
  
guiSetAlpha(onlogin, 0.00) 
guiSetAlpha(onregister, 0.00) 
guiSetAlpha(GUIEditor.button[3], 0.00) 
guiSetAlpha(GUIEditor.staticimage[1], 0.65) 
guiSetAlpha(GUIEditor.staticimage[2], 0.64) 
  
function login() 
    dxDrawText("Login - Register v.1", 330, 176, 483, 204, tocolor(255, 255, 255, 255), 1, "default", "left", "center", false, false, true, false, false) 
    dxDrawText(":اسم المستخدم ", 351, 219, 473, 238, tocolor(209, 178, 79, 255), 2, "default-bold", "left", "top", false, false, true, false, false) 
    dxDrawText(": كلمة المرور ", 350, 285, 463, 313, tocolor(209, 178, 79, 255), 2, "default", "left", "top", false, false, true, false, false) 
    dxDrawRectangle(296, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
    dxDrawRectangle(296, 470, 229, 41, tocolor(216, 189, 104, 255), true) 
    dxDrawLine(285, 219, 407, 248, tocolor(255, 255, 255, 255), 1, true) 
    dxDrawRectangle(416, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
    dxDrawLine(535, 219, 536, 540, tocolor(255, 255, 255, 255), 2, true) 
    dxDrawLine(285, 539, 536, 539, tocolor(255, 255, 255, 255), 2, true) 
    dxDrawLine(286, 219, 537, 219, tocolor(255, 255, 255, 255), 2, true) 
    dxDrawLine(286, 209, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
    dxDrawLine(286, 176, 537, 176, tocolor(255, 255, 255, 255), 2, true) 
    dxDrawLine(537, 176, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
    dxDrawLine(286, 176, 286, 209, tocolor(255, 255, 255, 255), 2, true) 
    dxDrawText("*سجل عشان تنحفظ ساعاتك", 293, 517, 511, 534, tocolor(199, 131, 1, 255), 1, "default-bold", "left", "top", true, false, true, false, false) 
    dxDrawText("تذكرني", 323, 353, 418, 373, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false, false) 
end 
  
addEventHandler("onClientRender", root, login) 
addEventHandler("onClientRender", root, login1) 
addEventHandler("onClientRender", root, login2) 
addEventHandler("onClientRender", root, Register1) 
addEventHandler("onClientRender", root, Register2) 
addEventHandler("onClientRender", root, Guest1) 
addEventHandler("onClientRender", root, Guest2) 
  
function login1() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, false, true, false, false) 
end 
  
    
function login2() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, false, true, false, false) 
end 
  
    
function Register1() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(47, 47, 51, 255), 2, "default", "left", "center", false, false, true, false, false) 
end 
  
function Register2() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(201, 0, 0, 255), 2, "default", "left", "center", false, false, true, false, false) 
end 
  
function Guest1() 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, true, true, false, false) 
end 
  
function Guest2) 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, true, true, false, false) 
end 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  onlogin ) then 
        triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    elseif ( source ==  onregister ) then 
        triggerServerEvent("onregister",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    end 
end 
  
function Show() 
    if source == GUIEditor.button[3] then 
        removeEventHandler("onClientRender", root, login) 
    end 
end 
  
addEventHandler ("onClientGUIClick", root, Show) 
  
 -- سو مثل كذا على كل الازرار وكذا 
function OnButton3 (  ) 
    if isElement ( GUIEditor.button[3] ) then 
    if eventName == 'onClientMouseEnter' then 
        addEventHandler("onClientRender", root, Guest2) 
    else 
        removeEventHandler("onClientRender", root, Guest2) 
        end 
    end 
end 
  
-- الكود الي فوق حق برستيجي  
  
addEventHandler( "onClientMouseEnter", GUIEditor.button[3], Show1 ) 
addEventHandler( "onClientMouseLeave", GUIEditor.button[3], Show1 ) 
Link to comment
"(" missing here

ac9c3c6180.png

function Guest2 () 

an other one ")" missing. here

6d93995527.png

end) 

BTW many things wrong in your code.

Debug :

ERROR:Loadin script failed: Dx_Login\c.lua:56:unexpected symbol near ')'

ابو عابد ترا كله حقك مو الي ابيه راجع حقي الكود زين

شكراا ابو عابد على الكوود ~

function OnButton3 ( )

if isElement ( GUIEditor.button[3] ) then

if eventName == 'onClientMouseEnter' then

addEventHandler("onClientRender", root, Guest2)

else

removeEventHandler("onClientRender", root, Guest2)

end

end

end

الحين في اشياء ما ضبطتها في كودي

Link to comment
      
    GUIEditor = { 
        edit = {}, 
        button = {}, 
        staticimage = {}, 
        checkbox = {}, 
    } 
      
    onlogin = guiCreateButton(295, 422, 107, 41, "", false) 
    guiSetAlpha(GUIEditor.button[1], 0.00) 
      
    onregister = guiCreateButton(414, 422, 108, 41, "", false) 
    guiSetAlpha(GUIEditor.button[2], 0.00) 
      
    GUIEditor.button[3] = guiCreateButton(295, 469, 228, 41, "", false) 
    guiSetAlpha(GUIEditor.button[3], 0.00) 
      
    GUIEditor.checkbox[1] = guiCreateCheckBox(306, 354, 15, 15, "تذكرني", false, false) 
      
    user = guiCreateEdit(20, 29, 208, 30, "",false) 
      
    pass = guiCreateEdit(20, 100, 208, 30, "",false) 
      
    GUIEditor.staticimage[1] = guiCreateStaticImage(286, 219, 250, 321, "S1.png", false) 
    guiSetAlpha(GUIEditor.staticimage[1], 0.65) 
      
      
    GUIEditor.staticimage[2] = guiCreateStaticImage(286, 176, 250, 33, "S1.png", false) 
    guiSetAlpha(GUIEditor.staticimage[2], 0.64) 
      
      
        function login() 
            dxDrawText("Login - Register v.1", 330, 176, 483, 204, tocolor(255, 255, 255, 255), 1, "default", "left", "center", false, false, true, false, false) 
            dxDrawText(":اسم المستخدم ", 351, 219, 473, 238, tocolor(209, 178, 79, 255), 2, "default-bold", "left", "top", false, false, true, false, false) 
            dxDrawText(": كلمة المرور ", 350, 285, 463, 313, tocolor(209, 178, 79, 255), 2, "default", "left", "top", false, false, true, false, false) 
            dxDrawRectangle(296, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
            dxDrawRectangle(296, 470, 229, 41, tocolor(216, 189, 104, 255), true) 
            dxDrawLine(285, 219, 407, 248, tocolor(255, 255, 255, 255), 1, true) 
            dxDrawRectangle(416, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
            dxDrawLine(535, 219, 536, 540, tocolor(255, 255, 255, 255), 2, true) 
            dxDrawLine(285, 539, 536, 539, tocolor(255, 255, 255, 255), 2, true) 
            dxDrawLine(286, 219, 537, 219, tocolor(255, 255, 255, 255), 2, true) 
            dxDrawLine(286, 209, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
            dxDrawLine(286, 176, 537, 176, tocolor(255, 255, 255, 255), 2, true) 
            dxDrawLine(537, 176, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
            dxDrawLine(286, 176, 286, 209, tocolor(255, 255, 255, 255), 2, true) 
            dxDrawText("*سجل عشان تنحفظ ساعاتك", 293, 517, 511, 534, tocolor(199, 131, 1, 255), 1, "default-bold", "left", "top", true, false, true, false, false) 
            dxDrawText("تذكرني", 323, 353, 418, 373, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false, false) 
        end 
    addEventHandler("onClientRender", root, login) 
      
        function login1() 
        dxDrawText("Login", 295, 422, 400, 461, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, false, true, false, false) 
        end 
        addEventHandler("onClientRender", root, login1) 
        
        function login2() 
        dxDrawText("Login", 295, 422, 400, 461, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, false, true, false, false) 
        end 
        addEventHandler("onClientRender", root, login2) 
        
        function Register1() 
        dxDrawText("Register", 425, 421, 575, 460, tocolor(47, 47, 51, 255), 2, "default", "left", "center", false, false, true, false, false) 
        end 
        addEventHandler("onClientRender", root, Register1) 
        
        function Register2() 
        dxDrawText("Register", 425, 421, 575, 460, tocolor(201, 0, 0, 255), 2, "default", "left", "center", false, false, true, false, false) 
        end 
        addEventHandler("onClientRender", root, Register2) 
      
        function Guest1() 
        dxDrawText(" Guest", 306, 474, 506, 506, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, true, true, false, false) 
        end 
        addEventHandler("onClientRender", root, Guest1) 
        
        function Guest2() 
        dxDrawText(" Guest", 306, 474, 506, 506, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, true, true, false, false) 
        end 
        addEventHandler("onClientRender", root, Guest2) 
        
        
        
    removeEventHandler("onClientRender", root, login1) 
    removeEventHandler("onClientRender", root, Register2) 
    removeEventHandler("onClientRender", root, Guest2) 
      
    addEventHandler ("onClientGUIClick", getRootElement(), 
    function(button, state, absoluteX, absoluteY) 
        if ( source ==  onlogin ) then 
            triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
        elseif ( source ==  onregister ) then 
            triggerServerEvent("onregister",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
        end 
    end) 
         
    function Show() 
    if source == GUIEditor.button[3] then 
      
    removeEventHandler("onClientRender", root, login) 
        end 
    end 
      
    addEventHandler ("onClientGUIClick", root, Show) 
      
      
      
    addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
       if ( source == onlogin ) then 
       addEventHandler("onClientRender", root, login1) 
       removeEventHandler("onClientRender", root, login2) 
      playSoundFrontEnd ( 1)   
         end 
    end ) 
      
    addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
       if ( source == onlogin  ) then 
               removeEventHandler("onClientRender", root, login1) 
               addEventHandler("onClientRender", root, login2) 
         end 
    end ) 
      
      
      
    addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
       if ( source == onregister ) then 
       addEventHandler("onClientRender", root, Register2) 
       removeEventHandler("onClientRender", root, Register1) 
      playSoundFrontEnd ( 1)   
         end 
    end ) 
      
      
      
    addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
       if ( source == onregister  ) then 
               removeEventHandler("onClientRender", root, Register2) 
               addEventHandler("onClientRender", root, Register1) 
         end 
    end ) 
      
      
      
    addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
       if ( source == GUIEditor.button[3]  ) then 
       addEventHandler("onClientRender", root, Guest2) 
       removeEventHandler("onClientRender", root, Guest1) 
      playSoundFrontEnd ( 1)   
         end 
    end ) 
      
      
      
    addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
       if ( source == GUIEditor.button[3]  ) then 
               removeEventHandler("onClientRender", root, Guest2) 
               addEventHandler("onClientRender", root, Guest1) 
         end 
    end ) 
      

Link to comment
  
GUIEditor = { 
    edit = {}, 
    button = {}, 
    staticimage = {}, 
    checkbox = {}, 
} 
  
onlogin = guiCreateButton(295, 422, 107, 41, "", false) 
guiSetAlpha(GUIEditor.button[1], 0.00) 
  
onregister = guiCreateButton(414, 422, 108, 41, "", false) 
guiSetAlpha(GUIEditor.button[2], 0.00) 
  
GUIEditor.button[3] = guiCreateButton(295, 469, 228, 41, "", false) 
guiSetAlpha(GUIEditor.button[3], 0.00) 
  
GUIEditor.checkbox[1] = guiCreateCheckBox(306, 354, 15, 15, "تذكرني", false, false) 
  
user = guiCreateEdit(20, 29, 208, 30, "",false) 
  
pass = guiCreateEdit(20, 100, 208, 30, "",false) 
  
GUIEditor.staticimage[1] = guiCreateStaticImage(286, 219, 250, 321, "S1.png", false) 
guiSetAlpha(GUIEditor.staticimage[1], 0.65) 
  
  
GUIEditor.staticimage[2] = guiCreateStaticImage(286, 176, 250, 33, "S1.png", false) 
guiSetAlpha(GUIEditor.staticimage[2], 0.64) 
  
  
    function login() 
        dxDrawText("Login - Register v.1", 330, 176, 483, 204, tocolor(255, 255, 255, 255), 1, "default", "left", "center", false, false, true, false, false) 
        dxDrawText(":اسم المستخدم ", 351, 219, 473, 238, tocolor(209, 178, 79, 255), 2, "default-bold", "left", "top", false, false, true, false, false) 
        dxDrawText(": كلمة المرور ", 350, 285, 463, 313, tocolor(209, 178, 79, 255), 2, "default", "left", "top", false, false, true, false, false) 
        dxDrawRectangle(296, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
        dxDrawRectangle(296, 470, 229, 41, tocolor(216, 189, 104, 255), true) 
        dxDrawLine(285, 219, 407, 248, tocolor(255, 255, 255, 255), 1, true) 
        dxDrawRectangle(416, 422, 109, 42, tocolor(216, 189, 104, 255), true) 
        dxDrawLine(535, 219, 536, 540, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(285, 539, 536, 539, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 219, 537, 219, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 209, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 176, 537, 176, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(537, 176, 537, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawLine(286, 176, 286, 209, tocolor(255, 255, 255, 255), 2, true) 
        dxDrawText("*سجل عشان تنحفظ ساعاتك", 293, 517, 511, 534, tocolor(199, 131, 1, 255), 1, "default-bold", "left", "top", true, false, true, false, false) 
        dxDrawText("تذكرني", 323, 353, 418, 373, tocolor(255, 255, 255, 255), 1, "default-bold", "left", "top", false, false, true, false, false) 
    end 
addEventHandler("onClientRender", root, login) 
  
    function login1() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, login1) 
    
    function login2() 
    dxDrawText("Login", 295, 422, 400, 461, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, login2) 
    
    function Register1() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(47, 47, 51, 255), 2, "default", "left", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Register1) 
    
    function Register2() 
    dxDrawText("Register", 425, 421, 575, 460, tocolor(201, 0, 0, 255), 2, "default", "left", "center", false, false, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Register2) 
  
    function Guest1() 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(47, 47, 51, 255), 2, "default", "center", "center", false, true, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Guest1) 
    
    function Guest2() 
    dxDrawText(" Guest", 306, 474, 506, 506, tocolor(201, 0, 0, 255), 2, "default", "center", "center", false, true, true, false, false) 
    end 
    addEventHandler("onClientRender", root, Guest2) 
    
    
    
removeEventHandler("onClientRender", root, login1) 
removeEventHandler("onClientRender", root, Register2) 
removeEventHandler("onClientRender", root, Guest2) 
  
addEventHandler ("onClientGUIClick", getRootElement(), 
function(button, state, absoluteX, absoluteY) 
    if ( source ==  onlogin ) then 
        triggerServerEvent("onlogin",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    elseif ( source ==  onregister ) then 
        triggerServerEvent("onregister",getLocalPlayer(), guiGetText(user), guiGetText(pass)) 
    end 
end 
function Show() 
if source == GUIEditor.button[3] then 
  
removeEventHandler("onClientRender", root, login) 
    end 
end 
  
addEventHandler ("onClientGUIClick", root, Show) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == onlogin ) then 
   addEventHandler("onClientRender", root, login1) 
   removeEventHandler("onClientRender", root, login2) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == onlogin  ) then 
           removeEventHandler("onClientRender", root, login1) 
           addEventHandler("onClientRender", root, login2) 
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == onregister ) then 
   addEventHandler("onClientRender", root, Register2) 
   removeEventHandler("onClientRender", root, Register1) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == onregister  ) then 
           removeEventHandler("onClientRender", root, Register2) 
           addEventHandler("onClientRender", root, Register1) 
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseEnter", guiRoot, function(  ) 
   if ( source == GUIEditor.button[3]  ) then 
   addEventHandler("onClientRender", root, Guest2) 
   removeEventHandler("onClientRender", root, Guest1) 
  playSoundFrontEnd ( 1)   
     end 
end ) 
  
  
  
addEventHandler( "onClientMouseLeave", guiRoot, function(  ) 
   if ( source == GUIEditor.button[3]  ) then 
           removeEventHandler("onClientRender", root, Guest2) 
           addEventHandler("onClientRender", root, Guest1) 
     end 
end ) 
  

Link to comment
  
    onClientGUIClick -- Event 
    xmlLoadFile 
    xmlCreateFile 
    xmlNodeSetValue 
    xmlCreateChild 
    xmlNodeSetAttribute 
    xmlSaveFile 
    xmlUnloadFile 
      
    onClientResourceStart -- Event 
    xmlLoadFile 
    xmlFindChild 
    xmlNodeGetValue 
      
      

Link to comment

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