Jump to content

ياخواني مافي احد يبي يساعدني كلكم ماتبون


Recommended Posts

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

هاد قيم مود

انا خليته يحفظ مكان والشخصيه بس بعد ماتختار المكان وشخصيه لما تموت مايوديك علي مكان وتفضل شاشة تدور

وش مشكلتها ممكن تقولو لي

هاد ملف سيرفر

addEventHandler("onPlayerJoin",root, 
    function () 
        spawnPlayer(source,-3398.9265136719+math.random(0,5),-3004.9460449219+math.random(0,5),5.0609378814697,0,0,0,0) 
        setCameraTarget(source,source) 
        fadeCamera(source,true) 
        setElementData(source,"new",true) 
    end 
) 
    
  
function getPlayerSkin(player) 
    if ( getElementData ( player , "skin" ) ) then 
        return getElementData(player,"skin") 
    else 
        return 46 
    end 
end 
  
function getPlayerXYZ(player) 
    if ( getElementData ( player, "x" ) and getElementData ( player, "y" ) and getElementData ( player, "z" ) ) then 
        local x,y,z = getElementData(player,"x"),getElementData(player,"y"),getElementData(player,"z") 
        return x,y,z 
    else 
        return -3751.69678,-3585.88672,13.69219 
    end 
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("onResourceStart", resourceRoot, 
    function () 
        executeSQLQuery("CREATE TABLE IF NOT EXISTS Accounts (NameAccount , Password )") 
        executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Register_GameMode ( serial, username, password )" ) 
        for k,v in ipairs ( getElementsByType ( "player" ) ) do 
            local x, y, z = unpack ( Positions_ [ math.random ( #Positions_ ) ] ) 
            fadeCamera ( v, false ) 
            setTimer ( spawnPlayer, 1200, 1, v, x, y, z, 90, 46 ) 
            setTimer ( setCameraTarget, 1500, 1, v ) 
            setTimer ( fadeCamera, 2000, 1, v, true ) 
        end 
    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, 216, 246, 114 ) 
                addData ( getPlayerSerial ( source ), user, pass ) 
            else 
                exports.msg2:OutPut( "* You Have Been Register And Login Successfully", source, 216, 246, 114 ) 
            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, 216, 246, 114 ) 
            else 
                exports.msg2:OutPut( "* You Have Been Successfuly Login", source, 216, 246, 114 ) 
            end 
        else 
            exports.msg2:OutPut( "* Worng Username or Password", source, 216, 246, 114 ) 
        end 
    end 
) 
     
addEvent("onGetData", true) 
addEventHandler("onGetData", 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 
) 

انا عدلت بس ملف سيرفر ولا لازم كمان نعدل علي كلنت

Edited by Guest
Link to comment

هادا ملف سيرفر الاصلي

local Positions_ = { 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
  
} 
    
  
    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("onResourceStart", resourceRoot, 
    function () 
        executeSQLQuery("CREATE TABLE IF NOT EXISTS Accounts (NameAccount , Password )") 
        executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Register_GameMode ( serial, username, password )" ) 
        for k,v in ipairs ( getElementsByType ( "player" ) ) do 
            local x, y, z = unpack ( Positions_ [ math.random ( #Positions_ ) ] ) 
            fadeCamera ( v, false ) 
            setTimer ( spawnPlayer, 1200, 1, v, x, y, z, 90, 46 ) 
            setTimer ( setCameraTarget, 1500, 1, v ) 
            setTimer ( fadeCamera, 2000, 1, v, true ) 
        end 
    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, 216, 246, 114 ) 
                addData ( getPlayerSerial ( source ), user, pass ) 
            else 
                exports.msg2:OutPut( "* You Have Been Register And Login Successfully", source, 216, 246, 114 ) 
            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, 216, 246, 114 ) 
            else 
                exports.msg2:OutPut( "* You Have Been Successfuly Login", source, 216, 246, 114 ) 
            end 
        else 
            exports.msg2:OutPut( "* Worng Username or Password", source, 216, 246, 114 ) 
        end 
    end 
) 
     
addEvent("onGetData", true) 
addEventHandler("onGetData", 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 
) 

هادا هو سيرفر بعد تعديل عليه

local Positions_ = { 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
  
} 
    
  
function getPlayerSkin(player) 
    if ( getElementData ( player , "skin" ) ) then 
        return getElementData(player,"skin") 
    else 
        return 46 
    end 
end 
  
function getPlayerXYZ(player) 
    if ( getElementData ( player, "x" ) and getElementData ( player, "y" ) and getElementData ( player, "z" ) ) then 
        local x,y,z = getElementData(player,"x"),getElementData(player,"y"),getElementData(player,"z") 
        return x,y,z 
    else 
        return -3751.69678,-3585.88672,13.69219 
    end 
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("onResourceStart", resourceRoot, 
    function () 
        executeSQLQuery("CREATE TABLE IF NOT EXISTS Accounts (NameAccount , Password )") 
        executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Register_GameMode ( serial, username, password )" ) 
        for k,v in ipairs ( getElementsByType ( "player" ) ) do 
            local x, y, z = unpack ( Positions_ [ math.random ( #Positions_ ) ] ) 
            fadeCamera ( v, false ) 
            setTimer ( spawnPlayer, 1200, 1, v, x, y, z, 90, 46 ) 
            setTimer ( setCameraTarget, 1500, 1, v ) 
            setTimer ( fadeCamera, 2000, 1, v, true ) 
        end 
    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, 216, 246, 114 ) 
                addData ( getPlayerSerial ( source ), user, pass ) 
            else 
                exports.msg2:OutPut( "* You Have Been Register And Login Successfully", source, 216, 246, 114 ) 
            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, 216, 246, 114 ) 
            else 
                exports.msg2:OutPut( "* You Have Been Successfuly Login", source, 216, 246, 114 ) 
            end 
        else 
            exports.msg2:OutPut( "* Worng Username or Password", source, 216, 246, 114 ) 
        end 
    end 
) 
     
addEvent("onGetData", true) 
addEventHandler("onGetData", 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 
) 

بس مانجح مش بيحفظ المكان والشخصية

Edited by Guest
Link to comment

local Positions_ = { 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
  
} 
    
  
    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("onResourceStart", resourceRoot, 
    function () 
        executeSQLQuery("CREATE TABLE IF NOT EXISTS Accounts (NameAccount , Password )") 
        executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Register_GameMode ( serial, username, password )" ) 
        for k,v in ipairs ( getElementsByType ( "player" ) ) do 
            local x, y, z = unpack ( Positions_ [ math.random ( #Positions_ ) ] ) 
            fadeCamera ( v, false ) 
            setTimer ( spawnPlayer, 1200, 1, v, x, y, z, 90, 46 ) 
            setTimer ( setCameraTarget, 1500, 1, v ) 
            setTimer ( fadeCamera, 2000, 1, v, true ) 
        end 
    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, 216, 246, 114 ) 
                addData ( getPlayerSerial ( source ), user, pass ) 
            else 
                exports.msg2:OutPut( "* You Have Been Register And Login Successfully", source, 216, 246, 114 ) 
            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, 216, 246, 114 ) 
            else 
                exports.msg2:OutPut( "* You Have Been Successfuly Login", source, 216, 246, 114 ) 
            end 
        else 
            exports.msg2:OutPut( "* Worng Username or Password", source, 216, 246, 114 ) 
        end 
    end 
) 
    
addEvent("onGetData", true) 
addEventHandler("onGetData", 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 ) 
        setTimer ( function ( ) 
        local skin = getElementModel (source) 
        local Place = getElementPosition ( source ) 
        setElementData ( source,"skin",skin) 
        setElementData ( source,"Place",Place) 
             end,3000,1 ) 
    end 
) 
  
addEventHandler  ("onPlayerWasted",root, function ( ) 
local sskin = getElementData (source,"skin") 
local x,y,z = getElementData ( source , "Place") 
setTimer (spawnPlayer ,3000,1,source,x,y,z,sskin) 
      end 
  ) 

جرب هذآ ^

play طفي سكربت الـ

أو أي سكربت يسوي سباون

Link to comment
مانجح كانك ماسويت شيء اختار المكان لما اموت يوديني الي المكان الرئيسي الي احداثيات الي بي سيرفر

ضفتل شاشة تدور

وبلاي ضافي

أفتح الدي بق

/debugscript 3

وسوي ريستارت للسكربت واختر السكن والمكان وانتحر شف يجيب خطأ ولا شيء ؟ :? ؟

Link to comment

local Positions_ = { 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 }, 
  
} 
    
  
    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("onResourceStart", resourceRoot, 
    function () 
        executeSQLQuery("CREATE TABLE IF NOT EXISTS Accounts (NameAccount , Password )") 
        executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Register_GameMode ( serial, username, password )" ) 
        for k,v in ipairs ( getElementsByType ( "player" ) ) do 
            local x, y, z = unpack ( Positions_ [ math.random ( #Positions_ ) ] ) 
            fadeCamera ( v, false ) 
            setTimer ( spawnPlayer, 1200, 1, v, x, y, z, 90, 46 ) 
            setTimer ( setCameraTarget, 1500, 1, v ) 
            setTimer ( fadeCamera, 2000, 1, v, true ) 
        end 
    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, 216, 246, 114 ) 
                addData ( getPlayerSerial ( source ), user, pass ) 
            else 
                exports.msg2:OutPut( "* You Have Been Register And Login Successfully", source, 216, 246, 114 ) 
            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, 216, 246, 114 ) 
            else 
                exports.msg2:OutPut( "* You Have Been Successfuly Login", source, 216, 246, 114 ) 
            end 
        else 
            exports.msg2:OutPut( "* Worng Username or Password", source, 216, 246, 114 ) 
        end 
    end 
) 
    
addEvent("onGetData", true) 
addEventHandler("onGetData", 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 ) 
        setTimer ( function ( ) 
        skin = getElementModel (source) 
        x,y,z = getElementPosition ( source ) 
             end,3000,1 ) 
    end 
) 
  
addEventHandler("onPlayerSpawn",root, function ( ) 
setTimer (spawnPlayer,1500,1,source,x,y,z,0,skin) 
      end 
  ) 
Link to comment
طيب بصراحاه انا لو طرحته بتقول عليه انه مسروق وانا وبتقول انا ماقدر اسويه لانه مسروق صح ولالا

وانا ابي اسويه وانت ماتبي تساعدني

طيب أطرح الكلنت وصآحب السكربت قال بالنهاية هو منشور منشور يعني أطرحه :lol:

Link to comment
local GUIEditor = { edit = {}, checkbox = {}, gridlist = {}, button = {}, label = {} } 
local Interpolate = {}
local sX, sY = guiGetScreenSize ()
local sizeY = sY * 0.03
local positionX = sX * 0.01
local r, g, b, a1, a2 = 131, 195, 254, 79, 79
local restangleX, restangleY = sX * 0.04, sY * 0.04
local showItemsLog_ = false
local showItemsLod_ = true
local Skins = {
    { "Saudi dress=| | الثوب الابيض|=", 46 },
    { "Saudi dress Winter | =|الثوب الاسود=", 124 },
    { "=|CJ | سي جي|=", 0 },
}
local mainTable = {
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125 , 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
}
local aldayariTable = {
    { 1820.47192, 872.12341, 10.62148 },
    { 1771.59448, 880.22327, 10.45102 },
    { 1772.50061, 820.93781, 10.65572 },
    { 1832.46057, 807.70935, 10.82031 },
}
local alnakheelTable = {
    { 2079.01294, 872.23877, 7.08329 },
    { 2034.68457, 884.44159, 7.38358 },
    { 2057.21558, 904.47754, 8.28524 },
}
local longTable = {
    { 277.24539, 1990.74329, 17.64063, 5 },
    { -3200.0637207031, -3039.6730957031, 5 },
    { -3165.2978515625, -3031.8530273438, 5 },
    { -3123.0417480469, -2963.7885742188, 5 },
}
local Places = {
    { "Main Place | =|البداية|=", mainTable },
    { "AlDayari | =|الدائري|=", aldayariTable },
    { "AlNakheel | =|النخيل|=", alnakheelTable },
    { "Long Street | =|الشارع الطويل|=", longTable },
}
 
function onEnter ( _, _, x, y )
    if ( x >= sX * 0.29 and y >= sY * 0.82 and x <= ( sX * 0.29 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        a1 = 255
    elseif ( x >= sX * 0.56 and y >= sY * 0.82 and x <= ( sX * 0.56 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        a2 = 255
    else
        a1 = 79
        a2 = 79
    end
end
 
function onClick ( _, _, x, y )
    if ( x >= sX * 0.29 and y >= sY * 0.82 and x <= ( sX * 0.29 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        if ( guiGetText ( GUIEditor.edit[1] ) ~= "" and guiGetText ( GUIEditor.edit[1] ) ~= " " ) then
            if ( guiGetText ( GUIEditor.edit[2] ) ~= "" and guiGetText ( GUIEditor.edit[2] ) ~= " " ) then
                if ( string.len ( guiGetText ( GUIEditor.edit[1] ) ) >= 3 ) then
                    if ( string.len ( guiGetText ( GUIEditor.edit[2] ) ) >= 4 ) then
                        if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[1] ) ) then
                            remeber = true
                        else
                            remeber = false
                        end
                        if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[2] ) ) then
                            destroyElement ( sound )
                        end
                        triggerServerEvent("onRegister", localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ), remeber)
                    else
                        exports.TopBarChat:sendClientMessage("* Password should be at least 4 characters long !", 216, 246, 114, true, 5)
                    end
                else
                    exports.TopBarChat:sendClientMessage("* Username should be at least 3 characters long !", 216, 246, 114, true)
                end
            else
                exports.TopBarChat:sendClientMessage("* Please Write Password !", 216, 246, 114, true)
            end
        else
            exports.TopBarChat:sendClientMessage("* Please Write Username !", 216, 246, 114, true)
        end
    elseif ( x >= sX * 0.56 and y >= sY * 0.82 and x <= ( sX * 0.56 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        if ( guiGetText ( GUIEditor.edit[1] ) ~= "" and guiGetText ( GUIEditor.edit[1] ) ~= " " ) then
            if ( guiGetText ( GUIEditor.edit[2] ) ~= "" and guiGetText ( GUIEditor.edit[2] ) ~= " " ) then
                if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[1] ) ) then
                    remeber = true
                else
                    remeber = false
                end
                if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[2] ) ) then
                    if ( isElement ( sound ) ) then
                        destroyElement ( sound )
                    end
                end
                triggerServerEvent("onLogin", localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ), remeber)
            else
                exports.TopBarChat:sendClientMessage("* Please Write Password !", 216, 246, 114, true)
            end
        else
            exports.TopBarChat:sendClientMessage("* Please Write Username !", 216, 246, 114, true)
        end
    end
end
 
function startLoginSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local _, height, _ = interpolateBetween ( 0, Interpolate.startSize[1], 0, 0, Interpolate.endSize[1], 0, progress, "OutElastic")
 
    sizeY = height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startLoginSystem )
        addEventHandler ( "onClientCursorMove", root, onEnter )
        addEventHandler ( "onClientClick", root, onClick )
        showItemsLog_ = true
        guiSetVisible ( GUIEditor.edit[1], true )
        guiSetVisible ( GUIEditor.edit[2], true )
        guiSetVisible ( GUIEditor.checkbox[1], true )
        guiSetVisible ( GUIEditor.checkbox[2], true )
        triggerServerEvent ( "onGetData", localPlayer )
        showCursor ( true )
        guiSetInputEnabled ( true )
    end
end
 
function stopLoginSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local _, height, _ = interpolateBetween ( 0, Interpolate.startSize[1], 0, 0, Interpolate.endSize[1], 0, progress, "OutElastic")
 
    sizeY = height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, stopLoginSystem )
        removeEventHandler ( "onClientRender", root, loginSystem )
        fadeCamera ( false, 5 )
        setTimer ( fadeCamera, 6000, 1, true )
        setTimer ( function ()
            smoothMoveCamera ( 2392.1313476563,-1601.9572753906,82.314598083496,2391.2177734375,-1601.8397216797,81.925178527832, 2252.5549316406,-1575.3922119141,29.895399093628,2251.6184082031,-1575.0538330078,29.802717208862, 5000 )
        end, 6000, 1 )
        setTimer ( function ()
            Interpolate.startTime = getTickCount ()
            Interpolate.startSize = { restangleX, restangleY }
            Interpolate.endSize = { sX * 0.26, sY * 0.70 }
            Interpolate.endTime = Interpolate.startTime + 4000
            addEventHandler("onClientRender", root, SpawnSystem)
            addEventHandler("onClientRender", root, startSpawnSystem)
            ped = createPed ( 46, 2247.0998535156, -1574.3897705078, 28.694995880127, 240 )
        end, 11000, 1 )
    end
end
 
function loginSystem ()
    dxDrawRectangle ( sX * 0.12, sY * 0.12, sX * 0.75, sizeY, tocolor(96, 96, 96, 100), false )
    if ( showItemsLog_ == true ) then
        dxDrawText ( "grand land \ Welcome To L.D", sX * 0.22, sY * 0.13, sX * 0.78, sY * 0.10, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "top", false, false, true, false, false )
        dxDrawImage ( sX * 0.16, sY * 0.18, sX * 0.67, sY * 0.41, "logo.png", 0, 0, 0, tocolor(247, 7, 233, 255), true )
        dxDrawText ( "Username :", sX * 0.30, sY * 0.63, sX * 0.42, sY * 0.66, tocolor(247, 7, 233, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false )
        dxDrawText ( "Password :", sX * 0.30, sY * 0.70, sX * 0.42, sY * 0.73, tocolor(247, 7, 233, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false )
        dxDrawRectangle ( sX * 0.29, sY * 0.82, sX * 0.18, sY * 0.06, tocolor(r, g, b, a1), true )
        dxDrawRectangle ( sX * 0.56, sY * 0.82, sX * 0.18, sY * 0.06, tocolor(r, g, b, a2), true )
        dxDrawText ( "=|Register|=", sX * 0.01, sY * 0.02, sX * 0.75, sY * 0.86, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "bottom", false, false, true, false, false )
        dxDrawText ( "=|Login|=", sX * 0.50, sY * 0.02, sX * 0.80, sY * 0.86, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "bottom", false, false, true, false, false )
    end
end
 
function startSpawnSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, height, _ = interpolateBetween ( Interpolate.startSize[1], Interpolate.startSize[2], 0, Interpolate.endSize[1], Interpolate.endSize[2], 0, progress, "OutElastic")
 
    restangleX, restangleY = width, height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startSpawnSystem )
        guiSetVisible ( GUIEditor.label[2], true )
        guiSetVisible ( GUIEditor.gridlist[1], true )
        guiSetVisible ( GUIEditor.label[3], true )
        guiSetVisible ( GUIEditor.gridlist[2], true )
        guiSetVisible ( GUIEditor.button[1], true )
        showCursor ( true )
        guiSetInputEnabled ( true )
    end
end
 
function stopSpawnSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, height, _ = interpolateBetween ( Interpolate.startSize[1], Interpolate.startSize[2], 0, Interpolate.endSize[1], Interpolate.endSize[2], 0, progress, "OutElastic")
 
    restangleX, restangleY = width, height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startSpawnSystem )
        removeEventHandler ( "onClientRender", root, SpawnSystem )
    end
end
 
function SpawnSystem ()
    dxDrawRectangle ( sX * 0.73, sY * 0.17, restangleX, restangleY, tocolor(247, 7, 233, 255), false )
end
 
function startLoadingSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, _, _ = interpolateBetween ( Interpolate.startPosition[1], 0, 0, Interpolate.endPosition[1], 0, 0, progress, "Linear")
 
    positionX = width
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startLoadingSystem )
        removeEventHandler ( "onClientRender", root, loadingSystem )
        sound = playSound ( "http://cdn.top4top.net/d_8da14106e91.mp3" )
        setCameraMatrix ( -3560.57178, -3050.54248, 61.04795 )
        fadeCamera ( true, 5 )
        setTimer ( function ()
            Interpolate.startTime = getTickCount ()
            Interpolate.startSize = { sY * 0.03 }
            Interpolate.endSize = { sY * 0.80 }
            Interpolate.endTime = Interpolate.startTime + 3000
            addEventHandler("onClientRender", root, loginSystem)
            addEventHandler("onClientRender", root, startLoginSystem)
        end, 6000, 1 )
    end
end
 
function loadingSystem ()
    dxDrawText ( "=[ Welcome To Server ]=", sX * 0.30, sY * 0.30, sX * 0.70, sY * 0.40, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "top", false, false, true, false, false )
   
Link to comment
local GUIEditor = { edit = {}, checkbox = {}, gridlist = {}, button = {}, label = {} } 
local Interpolate = {}
local sX, sY = guiGetScreenSize ()
local sizeY = sY * 0.03
local positionX = sX * 0.01
local r, g, b, a1, a2 = 131, 195, 254, 79, 79
local restangleX, restangleY = sX * 0.04, sY * 0.04
local showItemsLog_ = false
local showItemsLod_ = true
local Skins = {
    { "Saudi dress=| | الثوب الابيض|=", 46 },
    { "Saudi dress Winter | =|الثوب الاسود=", 124 },
    { "=|CJ | سي جي|=", 0 },
}
local mainTable = {
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125 , 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
}
local aldayariTable = {
    { 1820.47192, 872.12341, 10.62148 },
    { 1771.59448, 880.22327, 10.45102 },
    { 1772.50061, 820.93781, 10.65572 },
    { 1832.46057, 807.70935, 10.82031 },
}
local alnakheelTable = {
    { 2079.01294, 872.23877, 7.08329 },
    { 2034.68457, 884.44159, 7.38358 },
    { 2057.21558, 904.47754, 8.28524 },
}
local longTable = {
    { 277.24539, 1990.74329, 17.64063, 5 },
    { -3200.0637207031, -3039.6730957031, 5 },
    { -3165.2978515625, -3031.8530273438, 5 },
    { -3123.0417480469, -2963.7885742188, 5 },
}
local Places = {
    { "Main Place | =|البداية|=", mainTable },
    { "AlDayari | =|الدائري|=", aldayariTable },
    { "AlNakheel | =|النخيل|=", alnakheelTable },
    { "Long Street | =|الشارع الطويل|=", longTable },
}
 
function onEnter ( _, _, x, y )
    if ( x >= sX * 0.29 and y >= sY * 0.82 and x <= ( sX * 0.29 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        a1 = 255
    elseif ( x >= sX * 0.56 and y >= sY * 0.82 and x <= ( sX * 0.56 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        a2 = 255
    else
        a1 = 79
        a2 = 79
    end
end
 
function onClick ( _, _, x, y )
    if ( x >= sX * 0.29 and y >= sY * 0.82 and x <= ( sX * 0.29 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        if ( guiGetText ( GUIEditor.edit[1] ) ~= "" and guiGetText ( GUIEditor.edit[1] ) ~= " " ) then
            if ( guiGetText ( GUIEditor.edit[2] ) ~= "" and guiGetText ( GUIEditor.edit[2] ) ~= " " ) then
                if ( string.len ( guiGetText ( GUIEditor.edit[1] ) ) >= 3 ) then
                    if ( string.len ( guiGetText ( GUIEditor.edit[2] ) ) >= 4 ) then
                        if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[1] ) ) then
                            remeber = true
                        else
                            remeber = false
                        end
                        if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[2] ) ) then
                            destroyElement ( sound )
                        end
                        triggerServerEvent("onRegister", localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ), remeber)
                    else
                        exports.TopBarChat:sendClientMessage("* Password should be at least 4 characters long !", 216, 246, 114, true, 5)
                    end
                else
                    exports.TopBarChat:sendClientMessage("* Username should be at least 3 characters long !", 216, 246, 114, true)
                end
            else
                exports.TopBarChat:sendClientMessage("* Please Write Password !", 216, 246, 114, true)
            end
        else
            exports.TopBarChat:sendClientMessage("* Please Write Username !", 216, 246, 114, true)
        end
    elseif ( x >= sX * 0.56 and y >= sY * 0.82 and x <= ( sX * 0.56 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        if ( guiGetText ( GUIEditor.edit[1] ) ~= "" and guiGetText ( GUIEditor.edit[1] ) ~= " " ) then
            if ( guiGetText ( GUIEditor.edit[2] ) ~= "" and guiGetText ( GUIEditor.edit[2] ) ~= " " ) then
                if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[1] ) ) then
                    remeber = true
                else
                    remeber = false
                end
                if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[2] ) ) then
                    if ( isElement ( sound ) ) then
                        destroyElement ( sound )
                    end
                end
                triggerServerEvent("onLogin", localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ), remeber)
            else
                exports.TopBarChat:sendClientMessage("* Please Write Password !", 216, 246, 114, true)
            end
        else
            exports.TopBarChat:sendClientMessage("* Please Write Username !", 216, 246, 114, true)
        end
    end
end
 
function startLoginSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local _, height, _ = interpolateBetween ( 0, Interpolate.startSize[1], 0, 0, Interpolate.endSize[1], 0, progress, "OutElastic")
 
    sizeY = height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startLoginSystem )
        addEventHandler ( "onClientCursorMove", root, onEnter )
        addEventHandler ( "onClientClick", root, onClick )
        showItemsLog_ = true
        guiSetVisible ( GUIEditor.edit[1], true )
        guiSetVisible ( GUIEditor.edit[2], true )
        guiSetVisible ( GUIEditor.checkbox[1], true )
        guiSetVisible ( GUIEditor.checkbox[2], true )
        triggerServerEvent ( "onGetData", localPlayer )
        showCursor ( true )
        guiSetInputEnabled ( true )
    end
end
 
function stopLoginSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local _, height, _ = interpolateBetween ( 0, Interpolate.startSize[1], 0, 0, Interpolate.endSize[1], 0, progress, "OutElastic")
 
    sizeY = height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, stopLoginSystem )
        removeEventHandler ( "onClientRender", root, loginSystem )
        fadeCamera ( false, 5 )
        setTimer ( fadeCamera, 6000, 1, true )
        setTimer ( function ()
            smoothMoveCamera ( 2392.1313476563,-1601.9572753906,82.314598083496,2391.2177734375,-1601.8397216797,81.925178527832, 2252.5549316406,-1575.3922119141,29.895399093628,2251.6184082031,-1575.0538330078,29.802717208862, 5000 )
        end, 6000, 1 )
        setTimer ( function ()
            Interpolate.startTime = getTickCount ()
            Interpolate.startSize = { restangleX, restangleY }
            Interpolate.endSize = { sX * 0.26, sY * 0.70 }
            Interpolate.endTime = Interpolate.startTime + 4000
            addEventHandler("onClientRender", root, SpawnSystem)
            addEventHandler("onClientRender", root, startSpawnSystem)
            ped = createPed ( 46, 2247.0998535156, -1574.3897705078, 28.694995880127, 240 )
        end, 11000, 1 )
    end
end
 
function loginSystem ()
    dxDrawRectangle ( sX * 0.12, sY * 0.12, sX * 0.75, sizeY, tocolor(96, 96, 96, 100), false )
    if ( showItemsLog_ == true ) then
        dxDrawText ( "grand land \ Welcome To L.D", sX * 0.22, sY * 0.13, sX * 0.78, sY * 0.10, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "top", false, false, true, false, false )
        dxDrawImage ( sX * 0.16, sY * 0.18, sX * 0.67, sY * 0.41, "logo.png", 0, 0, 0, tocolor(247, 7, 233, 255), true )
        dxDrawText ( "Username :", sX * 0.30, sY * 0.63, sX * 0.42, sY * 0.66, tocolor(247, 7, 233, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false )
        dxDrawText ( "Password :", sX * 0.30, sY * 0.70, sX * 0.42, sY * 0.73, tocolor(247, 7, 233, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false )
        dxDrawRectangle ( sX * 0.29, sY * 0.82, sX * 0.18, sY * 0.06, tocolor(r, g, b, a1), true )
        dxDrawRectangle ( sX * 0.56, sY * 0.82, sX * 0.18, sY * 0.06, tocolor(r, g, b, a2), true )
        dxDrawText ( "=|Register|=", sX * 0.01, sY * 0.02, sX * 0.75, sY * 0.86, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "bottom", false, false, true, false, false )
        dxDrawText ( "=|Login|=", sX * 0.50, sY * 0.02, sX * 0.80, sY * 0.86, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "bottom", false, false, true, false, false )
    end
end
 
function startSpawnSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, height, _ = interpolateBetween ( Interpolate.startSize[1], Interpolate.startSize[2], 0, Interpolate.endSize[1], Interpolate.endSize[2], 0, progress, "OutElastic")
 
    restangleX, restangleY = width, height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startSpawnSystem )
        guiSetVisible ( GUIEditor.label[2], true )
        guiSetVisible ( GUIEditor.gridlist[1], true )
        guiSetVisible ( GUIEditor.label[3], true )
        guiSetVisible ( GUIEditor.gridlist[2], true )
        guiSetVisible ( GUIEditor.button[1], true )
        showCursor ( true )
        guiSetInputEnabled ( true )
    end
end
 
function stopSpawnSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, height, _ = interpolateBetween ( Interpolate.startSize[1], Interpolate.startSize[2], 0, Interpolate.endSize[1], Interpolate.endSize[2], 0, progress, "OutElastic")
 
    restangleX, restangleY = width, height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startSpawnSystem )
        removeEventHandler ( "onClientRender", root, SpawnSystem )
    end
end
 
function SpawnSystem ()
    dxDrawRectangle ( sX * 0.73, sY * 0.17, restangleX, restangleY, tocolor(247, 7, 233, 255), false )
end
 
function startLoadingSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, _, _ = interpolateBetween ( Interpolate.startPosition[1], 0, 0, Interpolate.endPosition[1], 0, 0, progress, "Linear")
 
    positionX = width
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startLoadingSystem )
        removeEventHandler ( "onClientRender", root, loadingSystem )
        sound = playSound ( "http://cdn.top4top.net/d_8da14106e91.mp3" )
        setCameraMatrix ( -3560.57178, -3050.54248, 61.04795 )
        fadeCamera ( true, 5 )
        setTimer ( function ()
            Interpolate.startTime = getTickCount ()
            Interpolate.startSize = { sY * 0.03 }
            Interpolate.endSize = { sY * 0.80 }
            Interpolate.endTime = Interpolate.startTime + 3000
            addEventHandler("onClientRender", root, loginSystem)
            addEventHandler("onClientRender", root, startLoginSystem)
        end, 6000, 1 )
    end
end
 
function loadingSystem ()
    dxDrawText ( "=[ Welcome To Server ]=", sX * 0.30, sY * 0.30, sX * 0.70, sY * 0.40, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "top", false, false, true, false, false )
   
Link to comment

-- Client Side 
 
local GUIEditor = { edit = {}, checkbox = {}, gridlist = {}, button = {}, label = {} }
local Interpolate = {}
local sX, sY = guiGetScreenSize ()
local sizeY = sY * 0.03
local positionX = sX * 0.01
local r, g, b, a1, a2 = 131, 195, 254, 79, 79
local restangleX, restangleY = sX * 0.04, sY * 0.04
local showItemsLog_ = false
local showItemsLod_ = true
local Skins = {
    { "Saudi dress=| | الثوب الابيض|=", 46 },
    { "Saudi dress Winter | =|الثوب الاسود=", 124 },
    { "=|CJ | سي جي|=", 0 },
}
local mainTable = {
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125 , 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
    { -3796.3701171875, -3005.2626953125, 5.1265625953674 },
}
local aldayariTable = {
    { 1820.47192, 872.12341, 10.62148 },
    { 1771.59448, 880.22327, 10.45102 },
    { 1772.50061, 820.93781, 10.65572 },
    { 1832.46057, 807.70935, 10.82031 },
}
local alnakheelTable = {
    { 2079.01294, 872.23877, 7.08329 },
    { 2034.68457, 884.44159, 7.38358 },
    { 2057.21558, 904.47754, 8.28524 },
}
local longTable = {
    { 277.24539, 1990.74329, 17.64063, 5 },
    { -3200.0637207031, -3039.6730957031, 5 },
    { -3165.2978515625, -3031.8530273438, 5 },
    { -3123.0417480469, -2963.7885742188, 5 },
}
local Places = {
    { "Main Place | =|البداية|=", mainTable },
    { "AlDayari | =|الدائري|=", aldayariTable },
    { "AlNakheel | =|النخيل|=", alnakheelTable },
    { "Long Street | =|الشارع الطويل|=", longTable },
}
 
function onEnter ( _, _, x, y )
    if ( x >= sX * 0.29 and y >= sY * 0.82 and x <= ( sX * 0.29 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        a1 = 255
    elseif ( x >= sX * 0.56 and y >= sY * 0.82 and x <= ( sX * 0.56 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        a2 = 255
    else
        a1 = 79
        a2 = 79
    end
end
 
function onClick ( _, _, x, y )
    if ( x >= sX * 0.29 and y >= sY * 0.82 and x <= ( sX * 0.29 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        if ( guiGetText ( GUIEditor.edit[1] ) ~= "" and guiGetText ( GUIEditor.edit[1] ) ~= " " ) then
            if ( guiGetText ( GUIEditor.edit[2] ) ~= "" and guiGetText ( GUIEditor.edit[2] ) ~= " " ) then
                if ( string.len ( guiGetText ( GUIEditor.edit[1] ) ) >= 3 ) then
                    if ( string.len ( guiGetText ( GUIEditor.edit[2] ) ) >= 4 ) then
                        if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[1] ) ) then
                            remeber = true
                        else
                            remeber = false
                        end
                        if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[2] ) ) then
                            destroyElement ( sound )
                        end
                        triggerServerEvent("onRegister", localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ), remeber)
                    else
                        exports.TopBarChat:sendClientMessage("* Password should be at least 4 characters long !", 216, 246, 114, true, 5)
                    end
                else
                    exports.TopBarChat:sendClientMessage("* Username should be at least 3 characters long !", 216, 246, 114, true)
                end
            else
                exports.TopBarChat:sendClientMessage("* Please Write Password !", 216, 246, 114, true)
            end
        else
            exports.TopBarChat:sendClientMessage("* Please Write Username !", 216, 246, 114, true)
        end
    elseif ( x >= sX * 0.56 and y >= sY * 0.82 and x <= ( sX * 0.56 + sX * 0.18 ) and y <= ( sY * 0.82 + sY * 0.06 ) ) then
        if ( guiGetText ( GUIEditor.edit[1] ) ~= "" and guiGetText ( GUIEditor.edit[1] ) ~= " " ) then
            if ( guiGetText ( GUIEditor.edit[2] ) ~= "" and guiGetText ( GUIEditor.edit[2] ) ~= " " ) then
                if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[1] ) ) then
                    remeber = true
                else
                    remeber = false
                end
                if ( guiCheckBoxGetSelected ( GUIEditor.checkbox[2] ) ) then
                    if ( isElement ( sound ) ) then
                        destroyElement ( sound )
                    end
                end
                triggerServerEvent("onLogin", localPlayer, guiGetText ( GUIEditor.edit[1] ), guiGetText ( GUIEditor.edit[2] ), remeber)
            else
                exports.TopBarChat:sendClientMessage("* Please Write Password !", 216, 246, 114, true)
            end
        else
            exports.TopBarChat:sendClientMessage("* Please Write Username !", 216, 246, 114, true)
        end
    end
end
 
function startLoginSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local _, height, _ = interpolateBetween ( 0, Interpolate.startSize[1], 0, 0, Interpolate.endSize[1], 0, progress, "OutElastic")
 
    sizeY = height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startLoginSystem )
        addEventHandler ( "onClientCursorMove", root, onEnter )
        addEventHandler ( "onClientClick", root, onClick )
        showItemsLog_ = true
        guiSetVisible ( GUIEditor.edit[1], true )
        guiSetVisible ( GUIEditor.edit[2], true )
        guiSetVisible ( GUIEditor.checkbox[1], true )
        guiSetVisible ( GUIEditor.checkbox[2], true )
        triggerServerEvent ( "onGetData", localPlayer )
        showCursor ( true )
        guiSetInputEnabled ( true )
    end
end
 
function stopLoginSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local _, height, _ = interpolateBetween ( 0, Interpolate.startSize[1], 0, 0, Interpolate.endSize[1], 0, progress, "OutElastic")
 
    sizeY = height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, stopLoginSystem )
        removeEventHandler ( "onClientRender", root, loginSystem )
        fadeCamera ( false, 5 )
        setTimer ( fadeCamera, 6000, 1, true )
        setTimer ( function ()
            smoothMoveCamera ( 2392.1313476563,-1601.9572753906,82.314598083496,2391.2177734375,-1601.8397216797,81.925178527832, 2252.5549316406,-1575.3922119141,29.895399093628,2251.6184082031,-1575.0538330078,29.802717208862, 5000 )
        end, 6000, 1 )
        setTimer ( function ()
            Interpolate.startTime = getTickCount ()
            Interpolate.startSize = { restangleX, restangleY }
            Interpolate.endSize = { sX * 0.26, sY * 0.70 }
            Interpolate.endTime = Interpolate.startTime + 4000
            addEventHandler("onClientRender", root, SpawnSystem)
            addEventHandler("onClientRender", root, startSpawnSystem)
            ped = createPed ( 46, 2247.0998535156, -1574.3897705078, 28.694995880127, 240 )
        end, 11000, 1 )
    end
end
 
function loginSystem ()
    dxDrawRectangle ( sX * 0.12, sY * 0.12, sX * 0.75, sizeY, tocolor(96, 96, 96, 100), false )
    if ( showItemsLog_ == true ) then
        dxDrawText ( "grand land \ Welcome To L.D", sX * 0.22, sY * 0.13, sX * 0.78, sY * 0.10, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "top", false, false, true, false, false )
        dxDrawImage ( sX * 0.16, sY * 0.18, sX * 0.67, sY * 0.41, "logo.png", 0, 0, 0, tocolor(247, 7, 233, 255), true )
        dxDrawText ( "Username :", sX * 0.30, sY * 0.63, sX * 0.42, sY * 0.66, tocolor(247, 7, 233, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false )
        dxDrawText ( "Password :", sX * 0.30, sY * 0.70, sX * 0.42, sY * 0.73, tocolor(247, 7, 233, 255), 1.30, "default-bold", "center", "center", false, false, true, false, false )
        dxDrawRectangle ( sX * 0.29, sY * 0.82, sX * 0.18, sY * 0.06, tocolor(r, g, b, a1), true )
        dxDrawRectangle ( sX * 0.56, sY * 0.82, sX * 0.18, sY * 0.06, tocolor(r, g, b, a2), true )
        dxDrawText ( "=|Register|=", sX * 0.01, sY * 0.02, sX * 0.75, sY * 0.86, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "bottom", false, false, true, false, false )
        dxDrawText ( "=|Login|=", sX * 0.50, sY * 0.02, sX * 0.80, sY * 0.86, tocolor(247, 7, 233, 255), 1.50, "default-bold", "center", "bottom", false, false, true, false, false )
    end
end
 
function startSpawnSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, height, _ = interpolateBetween ( Interpolate.startSize[1], Interpolate.startSize[2], 0, Interpolate.endSize[1], Interpolate.endSize[2], 0, progress, "OutElastic")
 
    restangleX, restangleY = width, height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startSpawnSystem )
        guiSetVisible ( GUIEditor.label[2], true )
        guiSetVisible ( GUIEditor.gridlist[1], true )
        guiSetVisible ( GUIEditor.label[3], true )
        guiSetVisible ( GUIEditor.gridlist[2], true )
        guiSetVisible ( GUIEditor.button[1], true )
        showCursor ( true )
        guiSetInputEnabled ( true )
    end
end
 
function stopSpawnSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, height, _ = interpolateBetween ( Interpolate.startSize[1], Interpolate.startSize[2], 0, Interpolate.endSize[1], Interpolate.endSize[2], 0, progress, "OutElastic")
 
    restangleX, restangleY = width, height
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startSpawnSystem )
        removeEventHandler ( "onClientRender", root, SpawnSystem )
    end
end
 
function SpawnSystem ()
    dxDrawRectangle ( sX * 0.73, sY * 0.17, restangleX, restangleY, tocolor(247, 7, 233, 255), false )
end
 
function startLoadingSystem ()
    local now = getTickCount()
    local elapsedTime = now - Interpolate.startTime
    local duration = Interpolate.endTime - Interpolate.startTime
    local progress = elapsedTime / duration
 
    local width, _, _ = interpolateBetween ( Interpolate.startPosition[1], 0, 0, Interpolate.endPosition[1], 0, 0, progress, "Linear")
 
    positionX = width
    if now >= Interpolate.endTime then
        removeEventHandler ( "onClientRender", root, startLoadingSystem )
        removeEventHandler ( "onClientRender", root, loadingSystem )
        sound = playSound ( "http://cdn.top4top.net/d_8da14106e91.mp3" )
        setCameraMatrix ( -3560.57178, -3050.54248, 61.04795 )
        fadeCamera ( true, 5 )
        setTimer ( function ()
            Interpolate.startTime = getTickCount ()
            Interpolate.startSize = { sY * 0.03 }
            Interpolate.endSize = { sY * 0.80 }
            Interpolate.endTime = Interpolate.startTime + 3000
            addEventHandler("onClientRender", root, loginSystem)
            addEventHandler("onClientRender", root, startLoginSystem)
        end, 6000, 1 )
    end
end
 
function loadingSystem ()
   
Link to comment
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...