Jump to content

مشكله ب مود


Recommended Posts

كـلـنـت

  
  
GUIEditor = { 
    checkbox = {}, 
    edit = {}, 
    button = {}, 
    window = {}, 
    label = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
local screenW, screenH = guiGetScreenSize() 
        GUIEditor.window[1] = guiCreateWindow((screenW - 635) / 2, (screenH - 481) / 2, 635, 481, "", false) 
        guiWindowSetSizable(GUIEditor.window[1], false) 
  
        GUIEditor.label[1] = guiCreateLabel(84, 45, 448, 49, "xX=[لـوحـة تسجيل آلسـيـرفـر]=Xx", false, GUIEditor.window[1]) 
        local font0_seguisym = guiCreateFont("seguisym.ttf", 21) 
        guiSetFont(GUIEditor.label[1], font0_seguisym) 
        guiLabelSetColor(GUIEditor.label[1], 57, 247, 151) 
        guiLabelSetHorizontalAlign(GUIEditor.label[1], "center", false) 
        GUIEditor.button[1] = guiCreateButton(136, 328, 142, 44, "=[  Register ] =", false, GUIEditor.window[1]) 
        local font1_seguisym = guiCreateFont("seguisym.ttf", 10) 
        guiSetFont(GUIEditor.button[1], font1_seguisym) 
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFB5E945") 
        GUIEditor.label[2] = guiCreateLabel(21, 142, 144, 42, "آسـم آلمـسـتـخـدم", false, GUIEditor.window[1]) 
        local font2_seguisym = guiCreateFont("seguisym.ttf", 15) 
        guiSetFont(GUIEditor.label[2], font2_seguisym) 
        guiLabelSetColor(GUIEditor.label[2], 240, 171, 63) 
        guiLabelSetHorizontalAlign(GUIEditor.label[2], "center", false) 
        GUIEditor.label[3] = guiCreateLabel(21, 220, 144, 42, "كـلـمـة آلمــرور", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.label[3], font2_seguisym) 
        guiLabelSetColor(GUIEditor.label[3], 240, 171, 63) 
        guiLabelSetHorizontalAlign(GUIEditor.label[3], "center", false) 
        GUIEditor.edit[1] = guiCreateEdit(185, 142, 205, 39, "آسمء آلمستخدمء", false, GUIEditor.window[1]) 
        GUIEditor.edit[2] = guiCreateEdit(185, 220, 205, 39, "كـلـمـة آلـمـرور", false, GUIEditor.window[1]) 
        GUIEditor.button[2] = guiCreateButton(302, 328, 142, 44, "=[ Login ] =", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[2], font1_seguisym) 
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFB5E945") 
        GUIEditor.checkbox[1] = guiCreateCheckBox(185, 284, 117, 25, "حفظ آلبيآنآت", false, false, GUIEditor.window[1]) 
        GUIEditor.button[3] = guiCreateButton(222, 391, 142, 44, "=[  Guest ] =", false, GUIEditor.window[1]) 
        guiSetFont(GUIEditor.button[3], font1_seguisym) 
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFB5E945")     
    end 
) 
  
  
addEventHandler("onClientGUIClick", guiRoot, function() 
  if source == GUIEditor.button[2] then 
    local Name = guiGetText(GUIEditor.edit[1]) 
    local Pass = guiGetText(GUIEditor.edit[2]) 
    if Name and string.len(tostring(Name)) >= 1 then 
      if Pass and string.len(tostring(Pass)) >= 3 then 
        triggerServerEvent("OnLogin", getLocalPlayer(), Name, Pass) 
      else 
        outputChatBox("* Error : Password Need To Be 3 number or up .", 255, 0, 0, true) 
      end 
    else 
      outputChatBox("* Error : User Name Need To Be 1 or up .", 255, 0, 0, true) 
    end 
  elseif source == GUIEditor.button[1] then 
      local Name = guiGetText(GUIEditor.edit[1]) 
      local Pass = guiGetText(GUIEditor.edit[2]) 
      if Name and string.len(tostring(Name)) >= 1 then 
        if Pass and string.len(tostring(Pass)) >= 3 then 
          triggerServerEvent("OnRegister", getLocalPlayer(), Name, Pass) 
      else 
        outputChatBox("* Error : Password Need To Be 3 number or up .", 255, 0, 0, true) 
      end 
    else 
      outputChatBox("* Error : User Name Need To Be 1 or up .", 255, 0, 0, true) 
    end 
  elseif source == GUIEditor.checkbox[1] then 
    if guiCheckBoxGetSelected(GUIEditor.checkbox[1]) == true then 
    triggerServerEvent("OnSave", localPlayer, guiGetText(GUIEditor.edit[2]), guiGetText(GUIEditor.edit[2])) 
    end 
  elseif source == GUIEditor.button[3] then 
    triggerEvent("Play",localPlayer) 
  end 
end) 
  
function move () 
    Wnd.a = getTickCount() 
    Wnd.endTime = Wnd.a + 1000 
    point1, point2, point3, point4 = 0, 0, x, y 
    addEventHandler("onClientRender", getRootElement(), MoveNow) 
end 
  
function MoveNow () 
  local Count = getTickCount() 
  local elapsedTime = Count - Wnd.a 
  local duration = Wnd.endTime - Wnd.a 
  local w, h, _ = interpolateBetween(point1, point2, 0, point3, point4, 0, elapsedTime / duration, "OutQuad") 
  guiSetSize( GUIEditor.window[1], w, h, false) 
  if Wnd.endTime <= Count then 
   removeEventHandler("onClientRender", getRootElement(), MoveNow) 
   showCursor(true) 
end 
end 
  
  
addEvent("Play",true) 
addEventHandler("Play",root,function() 
guiSetVisible( GUIEditor.window[1], false) 
showCursor(false) 
end) 
  
addEvent("UpRememberUser", true) 
addEventHandler("UpRememberUser", root, function(User, Pass) 
  guiSetText(GUIEditor.edit[1], User) 
  guiSetText(GUIEditor.edit[2], Pass) 
  guiCheckBoxSetSelected(GUIEditor.checkbox[1], true) 
end) 
  
  
addEvent("onClose", true) 
addEventHandler("onClose", root, function () 
    addEventHandler ( "onClientRender", root, stopLoginSystem ) 
    removeEventHandler ( "onClientCursorMove", root, onEnter ) 
    removeEventHandler ( "onClientClick", root, onClick ) 
    showItemsLog_ = false   guiSetVisible ( GUIEditor.label[3], false ) 
    guiSetVisible ( GUIEditor.window[1], false ) 
    showCursor ( false ) 
    guiSetInputEnabled ( false ) 
end) 
  

سيرفر

  
  
    function isPlayerSave ( serial ) 
  local Row = executeSQLQuery("SELECT * FROM Register_GameMode WHERE serial = ? ", serial) 
  if ( #Row == 0 ) or not ( Row ) then 
    return false 
  else 
    return true 
  end 
end 
  
function addData (serial, user, pass) 
  executeSQLQuery("INSERT INTO Register_GameMode ( serial, username, password ) VALUES (?, ?, ?)", serial, user, pass) 
end 
  
function getData ( serial ) 
    local user, pass = "", "" 
    local Row = executeSQLQuery("SELECT * FROM Register_GameMode WHERE serial = ? ", serial) 
    for k,v in ipairs ( Row ) do 
        if ( k == 1 ) then 
            user = v.username 
            pass = v.password 
        end 
    end 
    return user, pass 
end 
  
  
addEventHandler("onPlayerJoin", root, 
    function () 
        local x, y, z = unpack ( Positions_ [ math.random ( #Positions_ ) ] ) 
        fadeCamera ( source, false ) 
        setTimer ( spawnPlayer, 1000, 1, source, x, y, z, 90, 46 ) 
        setTimer ( setCameraTarget, 1200, 1, source ) 
        setTimer ( fadeCamera, 1500, 1, source, true ) 
    end 
) 
  
addEventHandler("onPlayerWasted", root, 
    function () 
        if ( getElementData ( source, 'isPlaying' ) == true ) then return end 
        if ( getElementData ( source, 'startIntro' ) == true ) then return end 
        local x, y, z = unpack ( Positions_ [ math.random ( #Positions_ ) ] ) 
        fadeCamera ( source, false ) 
        setTimer ( spawnPlayer, 1000, 1, source, x, y, z, 90, 46 ) 
        setTimer ( setCameraTarget, 1200, 1, source ) 
        setTimer ( fadeCamera, 1500, 1, source, true ) 
    end 
) 
  
addEvent("OnRegister", true) 
addEventHandler("OnRegister", root, 
    function ( user, pass, remeber ) 
        if not ( isGuestAccount ( getPlayerAccount ( source ) ) ) then return triggerClientEvent ( source, "onClose", source ) end 
        local account = getAccount ( user ) 
        if ( account ) then 
            exports.msg2:OutPut( "* This Account is Already Exist", source, 255, 0, 0 ) 
        else 
            addAccount ( user, pass ) 
            logIn ( source, getAccount ( user, pass ), pass ) 
            outputServerLog ( "PlayerName: [ ".. getPlayerName(source) .." ]  [ Username: [ " .. user .. " ] | Password: [ " .. pass .. " ] ]" ) 
            executeSQLQuery ( "INSERT INTO Accounts ( NameAccount, Password ) VALUES ( ?, ? )", user, pass ) 
            triggerClientEvent ( source, "onClose", source )  
            if ( remeber == true ) then 
                exports.msg2:OutPut( "* You Have Been Register And Login With Save Your Data Successfully", source, 255, 255, 0 ) 
                addData ( getPlayerSerial ( source ), user, pass ) 
            else 
                exports.msg2:OutPut( "* You Have Been Register And Login Successfully", source, 255, 255, 0 ) 
            end 
        end 
    end 
) 
  
addEvent("OnLogin", true) 
addEventHandler("OnLogin", root, 
    function ( user, pass, remeber ) 
        if not ( isGuestAccount ( getPlayerAccount ( source ) ) ) then return triggerClientEvent ( source, "onClose", source ) end 
        local account = getAccount ( user, pass ) 
        if ( account ) then 
            logIn ( source, account, pass ) 
            outputServerLog ( "PlayerName: [ ".. getPlayerName(source) .." ]  [ Username: [ " .. user .. " ] | Password: [ " .. pass .. " ] ]" ) 
            triggerClientEvent ( source, "onClose", source ) 
            if ( remeber == true ) then 
                if not ( isPlayerSave ( getPlayerSerial ( source ) ) ) then 
                    addData ( getPlayerSerial ( source ), user, pass ) 
                end 
                exports.msg2:OutPut( "* You Have Been Successfuly Login And Save Your Data", source, 255, 255, 0 ) 
            else 
                exports.msg2:OutPut( "* You Have Been Successfuly Login", source, 255, 255, 0 ) 
            end 
        else 
            exports.msg2:OutPut( "* Worng Username or Password", source, 255, 0, 0 ) 
        end 
    end 
) 
     
addEvent("OnSave", true) 
addEventHandler("OnSave", root, 
    function () 
        local serial = getPlayerSerial ( source ) 
        if ( isPlayerSave ( serial ) ) then 
            local username, password = getData ( serial ) 
            triggerClientEvent ( source, "onPutData", source, username, password ) 
        end 
    end 
) 
  
addEvent("onSpawn", true) 
addEventHandler("onSpawn", root, 
    function ( x, y, z, rz ) 
        if not ( rz ) then 
            rz = 0 
        end 
        spawnPlayer ( source, x, y, z, rz, getElementData ( source, "Skin" ) ) 
        setCameraTarget ( source ) 
        showChat ( source, true ) 
        fadeCamera ( source, true ) 
    end 
) 
  

المشكله : لم اضرب لوجن او رسجتر م يظهر شيء ب الشات

و المآوس آلموؤشر م يظهر

Link to comment
اول شي انت ضايف

showCursor بحدث onClientRender

وكيف بيشتغل يعني :(

حطو بحدث onClientResourceStart

+ بالنسبه لرسائل الشات

مبرمج لوحة التسجيل مسويها بسكربت رسائل خاص

تأكد من تشغيله

خلاص حليته و مشكورين والله

+ ابي كود لم اشغل لوحة التسجيل يجي مقطع صوتي لم اسجل و اخلص لم اضرب لوججن و تنشال الوحه يروح الصوت

Link to comment
playSound 
stopSound 
'onClientGUIClick' 

انا سويت كذا صح ؟

  
function ps() 
 playSound('music.mp3') 
fadeCamera(false) 
addEventHandler( "onResourceStart", resourceRoot, 
end 
) 
  

لا غلط

addEventHandler('onClientResourceStart',resourceRoot, 
function() 
    local Sound = playSound('sound.mp3') 
end 
) 
  
  
addEvent('stopSound',true) 
addEventHandler('stopSound',root, 
function() 
    stopSound(Sound) 
    Sound = nil 
end 
) 

كذا الكود جاهز بس ضيف ترايقر اذا سجل دخوله

Link to comment
playSound 
stopSound 
'onClientGUIClick' 

انا سويت كذا صح ؟

  
function ps() 
 playSound('music.mp3') 
fadeCamera(false) 
addEventHandler( "onResourceStart", resourceRoot, 
end 
) 
  

لا غلط

addEventHandler('onClientResourceStart',resourceRoot, 
function() 
    Sound = playSound('sound.mp3') 
end 
) 
  
  
addEvent('stopSound',true) 
addEventHandler('stopSound',root, 
function() 
    stopSound(Sound) 
    Sound = nil 
end 
) 

كذا الكود جاهز بس ضيف ترايقر اذا سجل دخوله

Link to comment
playSound 
stopSound 
'onClientGUIClick' 

انا سويت كذا صح ؟

  
function ps() 
 playSound('music.mp3') 
fadeCamera(false) 
addEventHandler( "onResourceStart", resourceRoot, 
end 
) 
  

لا غلط

addEventHandler('onClientResourceStart',resourceRoot, 
function() 
    Sound = playSound('sound.mp3') 
end 
) 
  
  
addEvent('stopSound',true) 
addEventHandler('stopSound',root, 
function() 
    stopSound(Sound) 
    Sound = nil 
end 
) 

كذا الكود جاهز بس ضيف ترايقر اذا سجل دخوله

شكرا ي الغالي تم

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