Jump to content

الرجو الدخول للي معهم خبره


Recommended Posts

السلام عليكم ابي كود الساعات او برمجة هذا المود

صنعتها بس ابيها تظر بالتاب

والقريد ليست يظهر لاعبين وكذا طبعا

وكذا

GUIEditor = {

edit = {},

button = {},

window = {},

label = {},

gridlist = {}

}

addEventHandler("onClientResourceStart", resourceRoot,

function()

GUIEditor.window[1] = guiCreateWindow(169, 85, 449, 464, "ساعات", false)

guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.gridlist[1] = guiCreateGridList(9, 20, 150, 434, false, GUIEditor.window[1])

guiGridListAddColumn(GUIEditor.gridlist[1], "Players", 0.9)

GUIEditor.button[1] = guiCreateButton(167, 41, 117, 55, "اعطاء ساعات", false, GUIEditor.window[1])

GUIEditor.button[2] = guiCreateButton(316, 41, 117, 55, "سحب ساعات", false, GUIEditor.window[1])

GUIEditor.edit[1] = guiCreateEdit(263, 116, 134, 57, "", false, GUIEditor.window[1])

GUIEditor.label[1] = guiCreateLabel(429, 344, 201, 15, "", false, GUIEditor.window[1])

GUIEditor.label[2] = guiCreateLabel(163, 339, 292, 30, "الكلمةةء الساعات المدة", false, GUIEditor.window[1])

GUIEditor.edit[2] = guiCreateEdit(331, 365, 78, 28, "", false, GUIEditor.window[1])

GUIEditor.edit[3] = guiCreateEdit(238, 365, 78, 28, "", false, GUIEditor.window[1])

GUIEditor.edit[4] = guiCreateEdit(153, 369, 78, 28, "", false, GUIEditor.window[1])

GUIEditor.button[3] = guiCreateButton(350, 417, 89, 37, "اغلاق اللوحة", false, GUIEditor.window[1])

GUIEditor.label[3] = guiCreateLabel(165, 425, 145, 24, "Mood By : KilleR", false, GUIEditor.window[1])

end

)

Link to comment
السلام عليكم ابي كود الساعات او برمجة هذا المود

صنعتها بس ابيها تظر بالتاب

والقريد ليست يظهر لاعبين وكذا طبعا

وكذا

GUIEditor = {

edit = {},

button = {},

window = {},

label = {},

gridlist = {}

}

addEventHandler("onClientResourceStart", resourceRoot,

function()

GUIEditor.window[1] = guiCreateWindow(169, 85, 449, 464, "ساعات", false)

guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.gridlist[1] = guiCreateGridList(9, 20, 150, 434, false, GUIEditor.window[1])

guiGridListAddColumn(GUIEditor.gridlist[1], "Players", 0.9)

GUIEditor.button[1] = guiCreateButton(167, 41, 117, 55, "اعطاء ساعات", false, GUIEditor.window[1])

GUIEditor.button[2] = guiCreateButton(316, 41, 117, 55, "سحب ساعات", false, GUIEditor.window[1])

GUIEditor.edit[1] = guiCreateEdit(263, 116, 134, 57, "", false, GUIEditor.window[1])

GUIEditor.label[1] = guiCreateLabel(429, 344, 201, 15, "", false, GUIEditor.window[1])

GUIEditor.label[2] = guiCreateLabel(163, 339, 292, 30, "الكلمةةء الساعات المدة", false, GUIEditor.window[1])

GUIEditor.edit[2] = guiCreateEdit(331, 365, 78, 28, "", false, GUIEditor.window[1])

GUIEditor.edit[3] = guiCreateEdit(238, 365, 78, 28, "", false, GUIEditor.window[1])

GUIEditor.edit[4] = guiCreateEdit(153, 369, 78, 28, "", false, GUIEditor.window[1])

GUIEditor.button[3] = guiCreateButton(350, 417, 89, 37, "اغلاق اللوحة", false, GUIEditor.window[1])

GUIEditor.label[3] = guiCreateLabel(165, 425, 145, 24, "Mood By : KilleR", false, GUIEditor.window[1])

end

)

يعني تبي اسماء الاعبين في القريد ليست؟

Link to comment

هذا كود عشان يجيب اسماء الاعبين في القريد ليست

حط الكود اذا فتحت اللوحه

guiGridListClear ( GUIEditor.gridlist[1] ) 
for i, v in next, getElementsByType ( "player" ) do 
     local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], Row, 1, getPlayerName ( v ), false, false ) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], Row, 2, getPlayerTime( v ), false, false ) 
    end 

Link to comment
etTimer( 
    function( ) 
        for _, v in pairs( getElementsByType( "player" ) ) do 
            if (not t[ v ]) then 
        local account = getPlayerAccount (v) 
            local hou = getAccountData ( account, "PlayTime-hour") or 0 
            local min = getAccountData ( account, "PlayTime-min") or 0 
            local sec = getAccountData ( account, "PlayTime-sec") or 0 
        t[ v ] = { 
                            ["hour"] = tonumber(hou), 
                             ["min"] = tonumber(min), 
                             ["sec"] = tonumber(sec) 
                            } 
                --[[t[ v ] = { 
                            ["hour"] = 0, 
                             ["min"] = 0, 
                             ["sec"] = 0 
                            }]] 
            end 
  
            t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 
            local min,sec = checkValues ( 
                    v, 
                    t[ v ][ 'min' ] or 0, 
                    t[ v ][ 'sec' ] or 0 
                        )   
    local hour = tonumber( t[ v ][ 'hour' ] or 0 ) 
  
            --[[setElementData( 
                v, 
                "Time", 
                tostring( hour )..':'..tostring( min )..':'..tostring( sec ) 
            )]] 
        end 
    end, 
    1000, 0 
) 
  
setTimer( 
    function( ) 
        for _, v in pairs( getElementsByType( "player" ) ) do 
            if (not t[ v ]) then 
        local account = getPlayerAccount (v) 
            local hou = getAccountData ( account, "PlayTime-hour") or 0 
            local min = getAccountData ( account, "PlayTime-min") or 0 
            local sec = getAccountData ( account, "PlayTime-sec") or 0 
        t[ v ] = { 
                            ["hour"] = tonumber(hou), 
                             ["min"] = tonumber(min), 
                             ["sec"] = tonumber(sec) 
                            } 
                --[[t[ v ] = { 
                            ["hour"] = 0, 
                             ["min"] = 0, 
                             ["sec"] = 0 
                            }]] 
            end 
  
            t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 
            local min,sec = checkValues ( 
                    v, 
                    t[ v ][ 'min' ] or 0, 
                    t[ v ][ 'sec' ] or 0 
                        )   
    local hour = tonumber( t[ v ][ 'hour' ] or 0 ) 
  
            setElementData( 
                v, 
                "Time", 
                tostring( hour )..' h - '..tostring( min )..' m' 
            ) 
        end 
    end, 
    1000, 1 
) 
    
function onPlayerQuit ( ) 
    local playeraccount = getPlayerAccount ( source ) 
    if ( playeraccount ) and not isGuestAccount ( playeraccount ) then 
        local sValue = getElementData( source,'Time' ) 
    local hour = tonumber( t[ source ][ 'hour' ] or 0 ) 
    local min = tonumber( t[ source ][ 'min' ] or 0 ) 
    local sec = tonumber( t[ source ][ 'sec' ] or 0 ) 
        setAccountData ( playeraccount, "PlayTime-hour", tostring(hour) ) 
        setAccountData ( playeraccount, "PlayTime-min", tostring(min) ) 
        setAccountData ( playeraccount, "PlayTime-sec", tostring(sec) ) 
        setAccountData ( playeraccount, "PlayTime", tostring(sValue) ) 
  
    end 
    t[ source ] = nil 
end 
  
function onPlayerLogin (_, playeraccount ) 
    if ( playeraccount ) then 
        local time = getAccountData ( playeraccount, "Time" ) 
    local hou = getAccountData ( playeraccount, "PlayTime-hour") 
    local min = getAccountData ( playeraccount, "PlayTime-min") 
    local sec = getAccountData ( playeraccount, "PlayTime-sec") 
        if ( time ) then 
            setElementData ( source, "Time", time ) 
  
                             t[ source ]["hour"] = tonumber(hou) 
                             t[ source ]["min"] = tonumber(min) 
                             t[ source ]["sec"] = tonumber(sec) 
                else 
            setElementData ( source, "Time",0 ) 
            setAccountData ( playeraccount, "Time",0 ) 
        end 
    end 
end 
addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) 
addEventHandler ( "onPlayerLogout", root, onPlayerQuit ) 
addEventHandler ( "onPlayerLogin", root, onPlayerLogin ) 
  
  
  
  
function onResStart (StartedRes) 
    if StartedRes == getThisResource() then 
        for _, players in ipairs(getElementsByType("player")) do 
        local account = getPlayerAccount (players) 
            if not (isGuestAccount (account)) then 
            local time = getAccountData ( account, "Time" ) 
            local hou = getAccountData ( account, "PlayTime-hour") or 0 
            local min = getAccountData ( account, "PlayTime-min") or 0 
            local sec = getAccountData ( account, "PlayTime-sec") or 0 
                if ( time ) then 
                    setElementData ( players, "Time", tonumber(time) ) 
  
                    --t[ players ]["hour"] = tonumber(hou) or 0 
                    --t[ players ]["min"] = tonumber(min) or 0 
                    --t[ players ]["sec"] = tonumber(sec) or 0 
                        else 
                    setElementData ( players, "Time",0 ) 
                    setAccountData ( account, "Time",0 ) 
                end 
            end 
        end 
    end 
end 
addEventHandler("onResourceStart", getRootElement(), onResStart) 
  
function onResStop (StopedRes) 
    if StopedRes == getThisResource() then 
        for _, players in ipairs(getElementsByType("player")) do 
        local account = getPlayerAccount (players) 
            if ( account ) then 
                if not (isGuestAccount (account)) then 
                    local sValue = getElementData( players,'Time' ) 
                    local hour = tonumber( t[ players ][ 'hour' ] or 0 ) 
                    local min = tonumber( t[ players ][ 'min' ] or 0 ) 
                    local sec = tonumber( t[ players ][ 'sec' ] or 0 ) 
                        setAccountData ( account, "PlayTime-hour", tostring(hour) ) 
                        setAccountData ( account, "PlayTime-min", tostring(min) ) 
                        setAccountData ( account, "PlayTime-sec", tostring(sec) ) 
                        setAccountData ( account, "PlayTime", tostring(sValue) ) 
  
                    end 
                t[ players ] = nil 
            end 
        end 
    end 
end 
addEventHandler("onResourceStop", getRootElement(), onResStop) 

جرب هاذا اخي الكريم :wink::wink:

Link to comment

هذا الكود كامل ركبه وبتجي اسماء اللاعبين كلها

  
local key = "F6" -- " استبدل اف6 بالزر اللي تبيه يفتح اللوحة لاتحذف هذي 
  
  
  
  
  
function guiGridListPrintPlayerNames( GridList ) 
    local players = getElementsByType("player") 
    for k, v in ipairs ( players ) do 
        if guiGridListClear(GridList) then 
            local row = guiGridListAddRow(GridList) 
            if row then 
                local name = guiGridListSetItemText(GridList, row, 1, getPlayerName(v), false, false) 
                local color = guiGridListSetItemColor(GridList, row, 1, 0, 255, 0) 
            end 
        end 
    end 
end 
  
  
GUIEditor = { 
edit = {}, 
button = {}, 
window = {}, 
label = {}, 
gridlist = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
GUIEditor.window[1] = guiCreateWindow(169, 85, 449, 464, "ساعات", false) 
guiWindowSetSizable(GUIEditor.window[1], false) 
  
GUIEditor.gridlist[1] = guiCreateGridList(9, 20, 150, 434, false, GUIEditor.window[1]) 
guiGridListAddColumn(GUIEditor.gridlist[1], "Players", 0.9) 
GUIEditor.button[1] = guiCreateButton(167, 41, 117, 55, "اعطاء ساعات", false, GUIEditor.window[1]) 
GUIEditor.button[2] = guiCreateButton(316, 41, 117, 55, "سحب ساعات", false, GUIEditor.window[1]) 
GUIEditor.edit[1] = guiCreateEdit(263, 116, 134, 57, "", false, GUIEditor.window[1]) 
GUIEditor.label[1] = guiCreateLabel(429, 344, 201, 15, "", false, GUIEditor.window[1]) 
GUIEditor.label[2] = guiCreateLabel(163, 339, 292, 30, "الكلمةةء الساعات المدة", false, GUIEditor.window[1]) 
GUIEditor.edit[2] = guiCreateEdit(331, 365, 78, 28, "", false, GUIEditor.window[1]) 
GUIEditor.edit[3] = guiCreateEdit(238, 365, 78, 28, "", false, GUIEditor.window[1]) 
GUIEditor.edit[4] = guiCreateEdit(153, 369, 78, 28, "", false, GUIEditor.window[1]) 
GUIEditor.button[3] = guiCreateButton(350, 417, 89, 37, "اغلاق اللوحة", false, GUIEditor.window[1]) 
GUIEditor.label[3] = guiCreateLabel(165, 425, 145, 24, "Mood By : KilleR", false, GUIEditor.window[1])  
end 
) 
  
  
bindKey(key, "down", 
     function() 
          guiSetVisible( GUIEditor.window[1] , not guiGetVisible(GUIEditor.window[1]) ) 
          showCursor( not guiGetVisible(GUIEditor.window[1]( ) 
          setTimer(guiGridListPrintPlayerNames, 1000, 1, GUIEditor.gridlist[1]) 
     end 
) 
  
  
  
Link to comment
هذا كود عشان يجيب اسماء الاعبين في القريد ليست

حط الكود اذا فتحت اللوحه

guiGridListClear ( GUIEditor.gridlist[1] ) 
for i, v in next, getElementsByType ( "player" ) do 
     local Row = guiGridListAddRow ( GUIEditor.gridlist[1] ) 
      guiGridListSetItemText ( GUIEditor.gridlist[1], Row, 1, getPlayerName ( v ), false, false ) 
    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...