Jump to content

مشكلة في تعديل لوحة الدخول في قيم مود


Riad-Host

Recommended Posts

بعد السطر ذا

logIn(source, account, password) 

تحط ذا الكود

شوف السيرفر في كود تسجيل الدخول لما يسجل دخول فيه تريقر للكلينت عشان يظهر اختيار التيم و الشخصية
triggerClientEvent(source, "onLoginSuccess", source) 

Link to comment

:scrambleup: يا نهار اسود

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

انا ما اقول لك ضيف الكود ذا

ذا موجود من قبل

logIn(source, account, password) 

انا اقول لك ضيف ذا بعده

triggerClientEvent(source, "onLoginSuccess", source) 

Link to comment

Client

  
local Anims = {"DAN_UP_A", "dnce_M_b", "DAN_Left_A", "DAN_Down_A", "DAN_Loop_A", "dance_loop"}
 
 
 
 
x, y = guiGetScreenSize()
font="default-bold"
fontTam=5
 
spcGam=dxGetTextWidth ("War-streets",fontTam,font)  -- اسم سيرفرك بالنجليزي
 
 
 
function intro()
    ahora = getTickCount()
    count=ahora-start
    dxDrawImage(0, 0, x, y, 'fondo.png',0,0,0,tocolor(255,255,255),false)
    sizeX=64*1.21
    sizeY=64*1.21
    varX,varY,varZ = anim(start,1000,spcGam,0,0,0,spcGam,150,"OutBack")
    dxDrawText("War-streets",0+x/2-varY/2,y/2-100,varY+x/2-varY/2,y,tocolor(38,205,0,255),fontTam,font,nil,nil,true)   ---- اسم سيرفرك
    dxDrawText("",1+x/-varY/6-dxGetTextWidth ("i",fontTam,font),y/2-100,varY+x/2-varY/2,y,tocolor(255,255,255,255),fontTam,font,nil,nil,false,false,false,true)
    dxDrawText("♥",x/2+varY/2,y/2-100,varY+x/2-varY/2,y,tocolor(255,255,255,255),fontTam,font,nil,nil,false,false,false,true)
    if (count>1500) then
    varX2,varY2,varZ2 = anim(start+1500,1000,0,0,0,200,250,360,"OutBack")
    dxDrawText("اهلا و سهلا بكم في سيرفر حرب الشوارع ",0+x/2-varY/2,y/2-100+dxGetFontHeight(fontTam,font),varY+x/2-varY/2,y,tocolor(255,255,255,varX2),1.5,font,"center",nil,false,false,false,true)   ---- اسم سيرفرك
    dxDrawText("نتمنا  ان ينال السيرفر اعجابكم",0+x/2-varY/2,y/2-80+dxGetFontHeight(fontTam,font),varY+x/2-varY/2,y,tocolor(255,255,255,varX2),1.5,font,"center",nil,false,false,false,true)   ---- اسم سيرفرك  
   dxDrawText("Welcome to sever War streets ..",0+x/2-varY/2,y/2-60+dxGetFontHeight(fontTam,font),varY+x/2-varY/2,y,tocolor(255,255,255,varX2),1.5,font,"center",nil,false,false,false,true)
   end
    if (count>2000) then
        varX2,varY3,varZ3 = anim(start+2000,1000*10,0,0,0,200,250,360*5,"Linear")
    dxDrawImage ( x/2-sizeX/2, y/2+50, sizeX, sizeY, 'img/cargando2.png',180+varZ3)
    dxDrawText("Loading..",12,y/2+60+sizeY+1,x,y,tocolor(0,0,0,85),1.5,font,"center",nil,false,false,false,true)
    dxDrawText("Loading..",10,y/2+60+sizeY,x,y,tocolor(255,255,255,255),1.5,font,"center",nil,false,false,false,true)
    end
end
 
function anim(tag,animTime,de1,de2,de3,hasta1,hasta2,hasta3,typeAnim)
    local now = getTickCount()
    local endTime = tag + animTime
    local elapsedTime = now - tag
    local duration = endTime - tag
    local progress = elapsedTime / duration
    local a, b, c = interpolateBetween ( de1,de2,de3,hasta1,hasta2,hasta3, progress, typeAnim)
   
    return a, b, c
end
 
fileDelete("intro_c.lua")
 
local sx, sy = guiGetScreenSize()
 
alpha = 250
MP = "files/1.png"
MX = sx
MY = sy
 
function adjIntro(adj)
    _, times = getTimerDetails(IntroTimer)
    if adj == "M1" then
        MX = (MX*0.95)+5
        MY = (MY*0.95)
        if times == 1 then
            setTimer(function()
                if (alpha <= 250) and not (alpha <= 0) then
                    alpha = alpha - 10
                else
                    IntroTimer = setTimer(adjIntro, 50, 26, "M2")
                end
            end, 50, 26)
        end
    elseif adj == "M2" then
        if (alpha < 250) and (alpha >= 0) then
            alpha = alpha + 10
        end
        MX = (MX/0.95)-5
        MY = (MY/0.95)
        MP = "files/2.png"
        if times == 1 then
            setTimer(function()
                MP = "files/3.png"
                setTimer(function()
                    IntroTimer = setTimer(adjIntro, 50, 26, "M3")
                end, 3500, 1)
            end, 4000, 1)
        end
    elseif adj == "M3" then
            MX = (MX*0.95)+5
            MY = (MY*0.95)
        if times == 1 then
            MP = "files/4.png"
            MX = (MX/0.95)-5
            MY = (MY/0.95)
            setTimer(function()
                setTimer(function()
                    if (alpha <= 250) and not (alpha <= 0) then
                        alpha = alpha - 10
                    else
                        removeEventHandler("onClientRender", root, drawIntro)
                        fadeCamera(true, 6, 0, 0, 0)
                        setCameraMatrix(-1475.5, 831.18, 65.5, -1487.5, 800.18, 65.5)
                        showCursor(true)
                        guiSetVisible(GUIEditor.window[1], true)
                        destroyElement(IntroSong)
                    end
                end, 50, 26)
            end, 3500, 1)
        end
    end
end
 
function drawIntro()
    dxDrawImage(sx/2-(MX/2), sy/2-(MY/2), MX, MY, MP, 0, 0, 0, tocolor(255, 255, 255, alpha))
end
 
 
function main()
    fadeCamera(false, 0)
    showChat(false)
    IntroSong = playSound("files/Intro.mp3")
    showPlayerHudComponent("all", false)
    start = getTickCount()
    addEventHandler("onClientRender",getRootElement(),intro)
    setTimer ( function()
    removeEventHandler("onClientRender",getRootElement(),intro)
    IntroTimer = setTimer(adjIntro, 50, 26, "M1")
    addEventHandler("onClientRender", root, drawIntro)
    triggerEvent("onFinishIntro",getRootElement())
    setCameraMatrix(-1475.5, 831.18, 65.5, -1487.5, 800.18, 65.5)
    end, 5000, 1 )
end
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),main)
 
sW,sH = guiGetScreenSize()
mX, mY = 0, 0
myFont = dxCreateFont( "opensans-light.ttf", 15 )
logoW, logoH = sW/8.4, sW/8.4
bgY = 0
function createLoginPanel()
    addEventHandler("onClientRender",getRootElement(),renderLoginPanel)
    addEventHandler("onClientRender",getRootElement(),renderButtons)
    showCursor(true,true)
    toggleAllControls(false)
    showChat(false)
    xml = xmlLoadFile("userdata.xml")
    loadXML()
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), createLoginPanel)
 
function loadXML()
  if not xml then
    xml = xmlCreateFile("userdata.xml","userdata")
    usernameChild = xmlCreateChild(xml,"username")
    passwordChild = xmlCreateChild(xml,"password")
    checkboxChild = xmlCreateChild(xml,"state")
    xmlSaveFile(xml)
  else
    usernameChild = xmlFindChild(xml,"username",0)
    passwordChild = xmlFindChild(xml,"password",0)
    checkboxChild = xmlFindChild(xml,"state",0)
  end
  if xmlNodeGetValue(checkboxChild) == "true" then
    checkboxs[1].state = true
  end
    usernameLoad = xmlNodeGetValue(usernameChild)
    passwordLoad = xmlNodeGetValue(passwordChild)
    for w in string.gmatch(usernameLoad, ".") do
      for i,ebox in ipairs(editbox) do
        if ebox.name == "username" then
          table.insert(text[i], w)
        end
      end
    end
    for w in string.gmatch(passwordLoad, ".") do
      for i,ebox in ipairs(editbox) do
        if ebox.name == "password" then
          table.insert(text[i], w)
        end
      end
    end
end
function saveXML(username,password,checkboxState)
  if checkboxs[1].state == true then
    xmlNodeSetValue(usernameChild,username)
    xmlNodeSetValue(passwordChild,password)
    xmlNodeSetValue(checkboxChild,tostring(checkboxState))
    xmlSaveFile(xml)
  else
    xmlNodeSetValue(usernameChild,"")
    xmlNodeSetValue(passwordChild,"")
    xmlNodeSetValue(checkboxChild,"")
    xmlSaveFile(xml)
  end
end
addEvent("saveXML",true)
addEventHandler("saveXML",getRootElement(),saveXML)
boxes = {
  {x = sW/2-sW/10, y = sH/2-sH/7, w = sW/5, h = sH/20, borderColor = tocolor(224, 224, 224), boxD = "green", text = "Please Log In", messageBox = "1"},
    {x = sW/2-sW/10, y = sH/2-sH/7.4+sH/18, w = sW/5, h = sW/5, borderColor = tocolor(224, 224, 224)},
  {x = sW/2-sW/10, y = sH/2-sH/7 + sH, w = sW/5, h = sH/20, borderColor = tocolor(224, 224, 224), boxD = "green", text = "Write username and password", messageBox = "2"},
  {x = sW/2-sW/10, y = sH/2-sH/7.4+sH/18 + sH, w = sW/5, h = sW/5, borderColor = tocolor(224, 224, 224)},
}
buttons = {
  {x = boxes[2].x + sW/47, y = boxes[2].y + boxes[2].h - sH/14, w = sW/13, h = boxes[2].w/6.5, color = tocolor(255,255,255), borderColor = tocolor(224, 224, 224), text = "Register", func = "pressRegisterBut"},
  {x = boxes[2].x + boxes[2].w - sW/47 - sW/13, y = boxes[2].y + boxes[2].h - sH/14, w = sW/13, h = boxes[2].w/6.5, color = tocolor(255,255,255), borderColor = tocolor(224, 224, 224), text = "Log In", func = "pressLogin"},
  {x = boxes[2].x + boxes[2].w - sW/47 - sW/13, y = boxes[2].y + boxes[2].h - sH/14 + sH, w = sW/13, h = boxes[2].w/6.5, color = tocolor(255,255,255), borderColor = tocolor(224, 224, 224), text = "Back", func = "pressBack"},
  {x = boxes[2].x + sW/47, y = boxes[2].y + boxes[2].h - sH/14 + sH, w = sW/13, h = boxes[2].w/6.5, color = tocolor(255,255,255), borderColor = tocolor(224, 224, 224), text = "Register", func = "pressRegister"}
}
editbox = {
  {x = boxes[2].x + sW/47, y = boxes[2].y + boxes[2].w/6.5, w = sW/13 + sW/13 + (boxes[2].w - sW/47 - sW/13 - sW/47 - sW/13), h = boxes[2].w/6.5, borderColor = tocolor(224, 224, 224), textUp = "Username", text = "", name = "username"},
  {x = boxes[2].x + sW/47, y = boxes[2].y + boxes[2].w/6.5 + boxes[2].w/6.5 + boxes[2].w/6.5, w = sW/13 + sW/13 + (boxes[2].w - sW/47 - sW/13 - sW/47 - sW/13), h = boxes[2].w/6.5, borderColor = tocolor(224, 224, 224), textUp = "Password", text = "", hide = true, name = "password"},
  {x = boxes[2].x + sW/47, y = boxes[2].y + boxes[2].w/6.5 + sH, w = sW/13 + sW/13 + (boxes[2].w - sW/47 - sW/13 - sW/47 - sW/13), h = boxes[2].w/6.5, borderColor = tocolor(224, 224, 224), textUp = "Username", text = "", name = "usernameReg"},
  {x = boxes[2].x + sW/47, y = boxes[2].y + boxes[2].w/6.5 + boxes[2].w/6.5 + boxes[2].w/6.5 + sH, w = sW/13 + sW/13 + (boxes[2].w - sW/47 - sW/13 - sW/47 - sW/13), h = boxes[2].w/6.5, borderColor = tocolor(224, 224, 224), textUp = "Password", text = "", hide = true, name = "passwordReg"},
}
checkboxs = {
  {x = boxes[2].x + sW/47, y = boxes[2].y + boxes[2].w/6.5 + boxes[2].w/6.5 + boxes[2].w/6 + boxes[2].w/6, wh = boxes[2].w/25, state = false, text = "Remember me"}
}
text = {}
for i,ebox in ipairs(editbox) do
table.insert(text,{})
end
bindKey("backspace", "down", function ()
  table.remove(text[eboxClickI], #text[eboxClickI])
end)
function getCharacter(character)
  for i,ebox in ipairs(editbox) do
    if eboxClickI == i then
      table.insert(text[i], character)
    end
  end
end
function renderLoginPanel()
    dxDrawRectangle(0 , bgY, sW, sH, tocolor(241, 241, 241))
    dxDrawImage ( sW/2 - logoW/2 + mX, boxes[1].y - logoH - sH/50 + mY, logoW, logoH, 'logo.png')
    dxDrawImage ( sW/2 - logoW/2 + mX, boxes[1].y - logoH - sH/50 + mY + sH, logoW, logoH, 'logo.png')
    for i,box in ipairs(boxes) do
        dxDrawRectangle(box.x + mX, box.y + mY, box.w, box.h)
        dxDrawRectangle(box.x + mX, box.y + mY, box.w, 1, box.borderColor)
        dxDrawRectangle(box.x + mX, box.y + mY, 1, box.h, box.borderColor)
        dxDrawRectangle(box.x + mX, box.y + box.h + mY, box.w, 1, box.borderColor)
        dxDrawRectangle(box.x + box.w + mX, box.y + mY, 1, box.h, box.borderColor)
    if box.boxD then
      if box.boxD == "green" then
      dxDrawRectangle(box.x + mX, box.y + mY, sW/160, box.h, tocolor(124,198,35))
      elseif box.boxD == "red" then
      dxDrawRectangle(box.x + mX, box.y + mY, sW/160, box.h, tocolor(255,0,0))
    end
    end
    if box.text then
       
Link to comment

انصحك اختصر الكود

يعني مثل ماسويت لـ هذي جدول

local Anims = {"DAN_UP_A", "dnce_M_b", "DAN_Left_A", "DAN_Down_A", "DAN_Loop_A", "dance_loop"} 

سوي لـ التيمات والاشياء الباقيه

عشان الكود مايصير هريسه :mrgreen:

Link to comment
local Anims = {"DAN_UP_A", "dnce_M_b", "DAN_Left_A", "DAN_Down_A", "DAN_Loop_A", "dance_loop"} 

وش دخل الحركات ب موضوعه

ياخوي هو كودهـ هريسه

انا نصحته يسوي جدول لـ التيمات احسن

والتيمات الحين كذا حوسه

setTeamFriendlyFire(createTeam("Grove",   0, 500, 0   ), false) 
setTeamFriendlyFire(createTeam("Vagos",   255, 200, 0 ), false) 
setTeamFriendlyFire(createTeam("Ballas",   128, 0, 128), false) 
setTeamFriendlyFire(createTeam("Mafia",   154,205,50  ), false) 
setTeamFriendlyFire(createTeam("Russians",   160,82,45), false) 
setTeamFriendlyFire(createTeam("Triads",   104,104,104), false) 
setTeamFriendlyFire(createTeam("Rifa",    250,128,114 ), false) 
setTeamFriendlyFire(createTeam("Street",    250,128,0 ), false) 
setTeamFriendlyFire(createTeam("Aztecas", 24, 198, 238), false) 
setTeamFriendlyFire(createTeam("Medic",  24, 255, 255 ), false) 
setTeamFriendlyFire(createTeam("Police",    0, 0, 255 ), false) 
createTeam("No Team", 255, 255, 255) 

انا قلت ايش ؟

يسوي لها جدول مثل ماسوى لـ الحركات

والأشياء الثانيه المتبعثرهـ xD

local Anims = {"DAN_UP_A", "dnce_M_b", "DAN_Left_A", "DAN_Down_A", "DAN_Loop_A", "dance_loop"} 

يعني ترتيب فقط لا غير :lol:

Link to comment
local Anims = {"DAN_UP_A", "dnce_M_b", "DAN_Left_A", "DAN_Down_A", "DAN_Loop_A", "dance_loop"} 

وش دخل الحركات ب موضوعه

ياخوي هو كودهـ هريسه

انا نصحته يسوي جدول لـ التيمات احسن

والتيمات الحين كذا حوسه

setTeamFriendlyFire(createTeam("Grove",   0, 500, 0   ), false) 
setTeamFriendlyFire(createTeam("Vagos",   255, 200, 0 ), false) 
setTeamFriendlyFire(createTeam("Ballas",   128, 0, 128), false) 
setTeamFriendlyFire(createTeam("Mafia",   154,205,50  ), false) 
setTeamFriendlyFire(createTeam("Russians",   160,82,45), false) 
setTeamFriendlyFire(createTeam("Triads",   104,104,104), false) 
setTeamFriendlyFire(createTeam("Rifa",    250,128,114 ), false) 
setTeamFriendlyFire(createTeam("Street",    250,128,0 ), false) 
setTeamFriendlyFire(createTeam("Aztecas", 24, 198, 238), false) 
setTeamFriendlyFire(createTeam("Medic",  24, 255, 255 ), false) 
setTeamFriendlyFire(createTeam("Police",    0, 0, 255 ), false) 
createTeam("No Team", 255, 255, 255) 

انا قلت ايش ؟

يسوي لها جدول مثل ماسوى لـ الحركات

والأشياء الثانيه المتبعثرهـ xD

local Anims = {"DAN_UP_A", "dnce_M_b", "DAN_Left_A", "DAN_Down_A", "DAN_Loop_A", "dance_loop"} 

يعني ترتيب فقط لا غير :lol:

هو القيم مود لهـ يوم تنصحه؟؟

هو ليس قادر على آن يعدل على سطرين بس

وتقول له سَوْ جدآول

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