Jump to content

مشكلة في كود


Recommended Posts

شو تبي بضبط

+

اطرح الكود كله لا تخاف ما راح يسرقوه + حتى لو سرقوه ما راح يعرفو يعدلوه وكمان المبرمجين الكبار شو راح يعملون فيه يصنعو قده عا 6 مائه مره

Link to comment

ههههههههههه اصلا المود جايبه من اليوتيوب

المهم

duelDims = {} 
 
duelRequests = {
    ["player"] = {},
    ["team"] = {},
}
 
spawnPoints = {
    ["Default Map"] = {
        ["Team1"] = {  
            [1] =  {-1483.0048828125, 1622.5152587891, 1052.53125, 14, 270},
            [2] =  {-1483.4129638672, 1614.3618164063, 1052.53125, 14, 270},
            [3] =  {-1487.3986816406, 1609.2513427734, 1052.53125, 14, 270},
            [4] =  {-1492.6645507813, 1613.9736328125, 1052.53125, 14, 270},
            [5] =  {-1492.2985839844, 1622.6396484375, 1052.53125, 14, 270},
        },
        ["Team2"] = {
            [1] =  {-1359.6483154297, 1591.6306152344, 1052.53125, 14, 90},
            [2] =  {-1365.2928466797, 1585.5966796875, 1052.53125, 14, 90},
            [3] =  {-1369.6888427734, 1579.4176025391, 1052.53125, 14, 90},
            [4] =  {-1360.5601806641, 1573.9606933594, 1052.53125, 14, 90},
            [5] =  {-1358.6953125, 1581.0498046875, 1052.53125, 14, 90},
        },
    },
    ["Chinatown Wars"] = {
        ["Team1"] = {  
            [1] =  {-2187.2556152344, 608.92541503906, 35.1640625, 0, 90},
            [2] =  {-2185.7873535156, 604.93310546875, 35.1640625, 0, 90},
            [3] =  {-2185.9548339844, 607.05328369141, 35.1640625, 0, 90},
            [4] =  {-2185.5200195313, 610.65301513672, 35.1640625, 0, 90},
            [5] =  {-2185.8056640625, 612.41656494141, 35.1640625, 0, 90},
        },
        ["Team2"] = {
            [1] =  {-2181.6726074219, 710.01104736328, 53.890625, 0, 180},
            [2] =  {-2178.7600097656, 710.79406738281, 53.890625, 0, 180},
            [3] =  {-2176.1784667969, 709.908203125, 53.890625, 0, 180},
            [4] =  {-2186.9445800781, 709.93585205078, 53.890625, 0, 180},
            [5] =  {-2184.1545410156, 710.86291503906, 53.890625, 0, 180},
        },
    },
    ["Golf Club"] = {
        ["Team1"] = {  
            [1] =  {1231.3547363281, 2768.7976074219, 10.8203125, 0, 90},
            [2] =  {1231.1342773438, 2765.7360839844, 10.8203125, 0, 90},
            [3] =  {1231.8992919922, 2773.0830078125, 10.8203125, 0, 90},
            [4] =  {1231.9095458984, 2776.2048339844, 10.8203125, 0, 90},
            [5] =  {1232.2651367188, 2762.9895019531, 10.828125, 0, 90},
        },
        ["Team2"] = {
            [1] =  {1141.3078613281, 2786.8815917969, 10.8203125, 0, 270},
            [2] =  {1141.7548828125, 2791.6772460938, 10.8203125, 0, 270},
            [3] =  {1138.4229736328, 2783.6474609375, 10.8203125, 0, 270},
            [4] =  {1133.7196044922, 2788.1672363281, 10.8203125, 0, 270},
            [5] =  {1134.8322753906, 2790.4851074219, 10.8203125, 0, 270},
        },
    },
    ["Boxing Ring"] = {
        ["Team1"] = {  
            [1] =  {758.80291748047, -1.8953230381012, 1001.5942382813, 5, 317.4},
            [2] =  {758.41174316406, -1.0586142539978, 1001.5942382813, 5, 268.5},
            [3] =  {758.77252197266, 0.022416202351451, 1001.5942382813, 5, 268.5},
            [4] =  {759.41802978516, -2.0041108131409, 1001.5942382813, 5, 359.7},
            [5] =  {760.84497070313, -2.0119335651398, 1001.5942382813, 5, 358.4},
        },
        ["Team2"] = {
            [1] =  {762.88323974609, 2.2570807933807, 1001.5942382813, 5, 137.6},
            [2] =  {761.68853759766, 2.2791578769684, 1001.5942382813, 5, 183.0},
            [3] =  {760.72412109375, 2.7128269672394, 1001.5942382813, 5, 180.8},
            [4] =  {763.29663085938, 1.8766915798187, 1001.5942382813, 5, 90.91},
            [5] =  {763.11193847656, 0.83970987796783, 1001.5942382813, 5, 84.9},
        },
    },
    ["Big Training Area"] = {
        ["Team1"] = {  
            [1] =  {2.3752818107605, 2501.5754394531, 16.484375, 0, 90},
            [2] =  {2.2181103229523, 2499.453125, 16.484375, 0, 90},
            [3] =  {1.8248146772385, 2503.2314453125, 16.484375, 0, 90},
            [4] =  {1.4833518266678, 2505.1154785156, 16.484375, 0, 90},
            [5] =  {1.1280332803726, 2497.251953125, 16.484375, 0, 90},
        },
        ["Team2"] = {
            [1] =  {413.44024658203, 2504.2932128906, 16.484375, 0, 270},
            [2] =  {413.86758422852, 2506.0925292969, 16.484375, 0, 270},
            [3] =  {414.35012817383, 2507.8078613281, 16.484375, 0, 270},
            [4] =  {413.54766845703, 2502.9409179688, 16.484375, 0, 270},
            [5] =  {413.94171142578, 2500.3596191406, 16.484375, 0, 270},
        },
    },
}
 
lastPlayerData = {}
 
for i=11000, 12000 do
    duelDims[i] = {}
    duelDims[i].used = nil
    duelDims[i].money = nil
    duelDims[i].dueltype = nil
    duelDims[i].src1 = nil
    duelDims[i].src2 = nil
    duelDims[i].rules = nil
end
 
for k, v in ipairs(getElementsByType("player")) do
    if (getElementData(v, "DuelIndex")) then removeElementData(v, "DuelIndex") end
end
 
function command_duel(player)
    local account = getPlayerAccount(player)
    if (not isGuestAccount(account)) then
        updatePlayerData(player, true, true, true, true)
    end
end
addCommandHandler("duel", command_duel)
 
function onPlayerQuit2()
    duelRequests["player"][source] = nil
    duelTeamInvites[source] = nil
    local team = getPlayerDuelTeam(source)
    if (team) then
        removePlayerFromDuelTeam(source)
    end
end
addEventHandler("onPlayerQuit", root, onPlayerQuit2)
 
function sendDuelChallenge(duelType, player, moneyAmount, rules, map)
    if (duelType == "single") then
        if (isElement(player)) then
            local acc = getPlayerAccount(player)
            if (isGuestAccount(acc)) then return end
            if (not duelRequests["player"][player]) then
                duelRequests["player"][player] = {}
            end
            if (not duelRequests["player"][player][client]) then
                duelRequests["player"][player][client] = {moneyAmount or 0, rules, map}
                exports["topbarchat"]:sendClientMessage("Duel challenge has been sent to "..getPlayerName(player), client, 0, 255, 0)
                --exports.CITaccounts:invSet(acc, "totalDuels", (exports.CITaccounts:invGet(acc, "totalDuels") or 0) + 1)
            else
                exports["topbarchat"]:sendClientMessage("You've already sent a duel request to this player", client, 0, 255, 0)
            end
        else
            outputChatBox(client, "Player is offline", 255, 0, 0)
        end
    elseif (duelType == "team") then
        if (type(player) == "string") then
            local playerTeam = getPlayerDuelTeam(client)
            local team = player
            if (isPlayerDuelTeamLeader(client)) then
                if (teamList[team]) then
                    if (team ~= playerTeam) then
                        if (not duelRequests["team"][team]) then
                            duelRequests["team"][team] = {}
                        end
                        if (not duelRequests["team"][team][playerTeam]) then
                            duelRequests["team"][team][playerTeam] = {moneyAmount or 0, rules, map}
                            exports["topbarchat"]:sendClientMessage("Duel challenge has been sent to team "..team, client, 0, 255, 0)
                        else
                            exports["topbarchat"]:sendClientMessage("You've already sent a duel request to this team", client, 0, 255, 0)
                        end
                    else
                        exports["topbarchat"]:sendClientMessage("You can not challenge your own team", client, 0, 255, 0)
                    end
                else
                    exports["topbarchat"]:sendClientMessage("Team does not exist", client, 0, 255, 0)
                end
            end
        end
    end
end
addEvent("CITduel.SendDuelChallenge", true)
addEventHandler("CITduel.SendDuelChallenge", root, sendDuelChallenge)
 
function updatePlayerData(player, sDuelTeam, sDuelReq, sTeamList, showWindow)
    if (isElement(player)) then
        local account = getPlayerAccount(player)
        if (not isGuestAccount(account)) then
            local wonDuels = 0
            local lostDuels = 0
            local totalDuels = 0
            local duelTeam
            local duelReq
            local isDuelTeamLeader
            local tList
            local teamInvites
            if (sDuelTeam) then
                duelTeam = getPlayerDuelTeam(player)
                isDuelTeamLeader = isPlayerDuelTeamLeader(player)
            end
            if (sDuelReq) then
                duelReq = getPlayerDuelRequests(player)
            end
            if (sTeamList) then
                tList = teamList
                teamInvites = duelTeamInvites[player]
            end
 
            triggerLatentClientEvent(player, "CITduel.ShowWindow", player, wonDuels, lostDuels, totalDuels, duelTeam, duelReq, isDuelTeamLeader, tList, showWindow, teamInvites)
        end
    end
end
 
function rejectAllChallenges()
    local duelTeam = getPlayerDuelTeam(client)
    if (duelRequests["player"][client]) then
        duelRequests["player"][client] = nil
    end
    if (duelTeam and isPlayerDuelTeamLeader(client)) then
        duelRequests["team"][duelTeam] = nil
    end
    updatePlayerData(client, false, true, false, false)
end
addEvent("CITduel.RejectAllChallenges", true)
addEventHandler("CITduel.RejectAllChallenges", root, rejectAllChallenges)
 
function rejectChallenge(src, dtype)
    if (dtype == "Single Duel") then
        if (isElement(src)) then
            duelRequests["player"][client][src] = nil
        else
            for k, v in pairs(duelRequests["player"][client]) do
                if (not isElement(k)) then
                    duelRequests["player"][client][k] = nil
                end
            end
        end
    else
        local duelTeam = getPlayerDuelTeam(client)
        if (duelTeam and isPlayerDuelTeamLeader(client) and duelRequests["team"][duelTeam]) then
            duelRequests["team"][duelTeam][src] = nil
        end
    end
    updatePlayerData(client, false, true, false, false)
end
addEvent("CITduel.RejectChallenge", true)
addEventHandler("CITduel.RejectChallenge", root, rejectChallenge)
 
function acceptDuelChallenge(src, dtype)
    if (dtype == "Single Duel") then
        if (not isElement(src)) then return end
        if (duelRequests["player"][client][src]) then
            local tempData = duelRequests["player"][client][src]
            local ptable = {client, src}
            duelRequests["player"][client][src] = nil
            for k, v in ipairs(ptable) do
                local playerCanDuel, errMsg = canPlayerDuel(v, {tempData[1]})
                if (not playerCanDuel) then
                    for key, val in ipairs(ptable) do
                        if (val ~= v) then
                            exports["topbarchat"]:sendClientMessage(getPlayerName(v).." won't participate in this duel because: "..errorMessages[errMsg][1], val, 255, 0, 0)
                            exports["topbarchat"]:sendClientMessage("Duel has been aborted", val, 255, 0, 0)
                        end
                    end
                    exports
Link to comment
ههههههههههه اصلا المود جايبه من اليوتيوب

المهم

duelDims = {} 
 
duelRequests = {
    ["player"] = {},
    ["team"] = {},
}
 
spawnPoints = {
    ["Default Map"] = {
        ["Team1"] = {  
            [1] =  {-1483.0048828125, 1622.5152587891, 1052.53125, 14, 270},
            [2] =  {-1483.4129638672, 1614.3618164063, 1052.53125, 14, 270},
            [3] =  {-1487.3986816406, 1609.2513427734, 1052.53125, 14, 270},
            [4] =  {-1492.6645507813, 1613.9736328125, 1052.53125, 14, 270},
            [5] =  {-1492.2985839844, 1622.6396484375, 1052.53125, 14, 270},
        },
        ["Team2"] = {
            [1] =  {-1359.6483154297, 1591.6306152344, 1052.53125, 14, 90},
            [2] =  {-1365.2928466797, 1585.5966796875, 1052.53125, 14, 90},
            [3] =  {-1369.6888427734, 1579.4176025391, 1052.53125, 14, 90},
            [4] =  {-1360.5601806641, 1573.9606933594, 1052.53125, 14, 90},
            [5] =  {-1358.6953125, 1581.0498046875, 1052.53125, 14, 90},
        },
    },
    ["Chinatown Wars"] = {
        ["Team1"] = {  
            [1] =  {-2187.2556152344, 608.92541503906, 35.1640625, 0, 90},
            [2] =  {-2185.7873535156, 604.93310546875, 35.1640625, 0, 90},
            [3] =  {-2185.9548339844, 607.05328369141, 35.1640625, 0, 90},
            [4] =  {-2185.5200195313, 610.65301513672, 35.1640625, 0, 90},
            [5] =  {-2185.8056640625, 612.41656494141, 35.1640625, 0, 90},
        },
        ["Team2"] = {
            [1] =  {-2181.6726074219, 710.01104736328, 53.890625, 0, 180},
            [2] =  {-2178.7600097656, 710.79406738281, 53.890625, 0, 180},
            [3] =  {-2176.1784667969, 709.908203125, 53.890625, 0, 180},
            [4] =  {-2186.9445800781, 709.93585205078, 53.890625, 0, 180},
            [5] =  {-2184.1545410156, 710.86291503906, 53.890625, 0, 180},
        },
    },
    ["Golf Club"] = {
        ["Team1"] = {  
            [1] =  {1231.3547363281, 2768.7976074219, 10.8203125, 0, 90},
            [2] =  {1231.1342773438, 2765.7360839844, 10.8203125, 0, 90},
            [3] =  {1231.8992919922, 2773.0830078125, 10.8203125, 0, 90},
            [4] =  {1231.9095458984, 2776.2048339844, 10.8203125, 0, 90},
            [5] =  {1232.2651367188, 2762.9895019531, 10.828125, 0, 90},
        },
        ["Team2"] = {
            [1] =  {1141.3078613281, 2786.8815917969, 10.8203125, 0, 270},
            [2] =  {1141.7548828125, 2791.6772460938, 10.8203125, 0, 270},
            [3] =  {1138.4229736328, 2783.6474609375, 10.8203125, 0, 270},
            [4] =  {1133.7196044922, 2788.1672363281, 10.8203125, 0, 270},
            [5] =  {1134.8322753906, 2790.4851074219, 10.8203125, 0, 270},
        },
    },
    ["Boxing Ring"] = {
        ["Team1"] = {  
            [1] =  {758.80291748047, -1.8953230381012, 1001.5942382813, 5, 317.4},
            [2] =  {758.41174316406, -1.0586142539978, 1001.5942382813, 5, 268.5},
            [3] =  {758.77252197266, 0.022416202351451, 1001.5942382813, 5, 268.5},
            [4] =  {759.41802978516, -2.0041108131409, 1001.5942382813, 5, 359.7},
            [5] =  {760.84497070313, -2.0119335651398, 1001.5942382813, 5, 358.4},
        },
        ["Team2"] = {
            [1] =  {762.88323974609, 2.2570807933807, 1001.5942382813, 5, 137.6},
            [2] =  {761.68853759766, 2.2791578769684, 1001.5942382813, 5, 183.0},
            [3] =  {760.72412109375, 2.7128269672394, 1001.5942382813, 5, 180.8},
            [4] =  {763.29663085938, 1.8766915798187, 1001.5942382813, 5, 90.91},
            [5] =  {763.11193847656, 0.83970987796783, 1001.5942382813, 5, 84.9},
        },
    },
    ["Big Training Area"] = {
        ["Team1"] = {  
            [1] =  {2.3752818107605, 2501.5754394531, 16.484375, 0, 90},
            [2] =  {2.2181103229523, 2499.453125, 16.484375, 0, 90},
            [3] =  {1.8248146772385, 2503.2314453125, 16.484375, 0, 90},
            [4] =  {1.4833518266678, 2505.1154785156, 16.484375, 0, 90},
            [5] =  {1.1280332803726, 2497.251953125, 16.484375, 0, 90},
        },
        ["Team2"] = {
            [1] =  {413.44024658203, 2504.2932128906, 16.484375, 0, 270},
            [2] =  {413.86758422852, 2506.0925292969, 16.484375, 0, 270},
            [3] =  {414.35012817383, 2507.8078613281, 16.484375, 0, 270},
            [4] =  {413.54766845703, 2502.9409179688, 16.484375, 0, 270},
            [5] =  {413.94171142578, 2500.3596191406, 16.484375, 0, 270},
        },
    },
}
 
lastPlayerData = {}
 
for i=11000, 12000 do
    duelDims[i] = {}
    duelDims[i].used = nil
    duelDims[i].money = nil
    duelDims[i].dueltype = nil
    duelDims[i].src1 = nil
    duelDims[i].src2 = nil
    duelDims[i].rules = nil
end
 
for k, v in ipairs(getElementsByType("player")) do
    if (getElementData(v, "DuelIndex")) then removeElementData(v, "DuelIndex") end
end
 
function command_duel(player)
    local account = getPlayerAccount(player)
    if (not isGuestAccount(account)) then
        updatePlayerData(player, true, true, true, true)
    end
end
addCommandHandler("duel", command_duel)
 
function onPlayerQuit2()
    duelRequests["player"][source] = nil
    duelTeamInvites[source] = nil
    local team = getPlayerDuelTeam(source)
    if (team) then
        removePlayerFromDuelTeam(source)
    end
end
addEventHandler("onPlayerQuit", root, onPlayerQuit2)
 
function sendDuelChallenge(duelType, player, moneyAmount, rules, map)
    if (duelType == "single") then
        if (isElement(player)) then
            local acc = getPlayerAccount(player)
            if (isGuestAccount(acc)) then return end
            if (not duelRequests["player"][player]) then
                duelRequests["player"][player] = {}
            end
            if (not duelRequests["player"][player][client]) then
                duelRequests["player"][player][client] = {moneyAmount or 0, rules, map}
                exports["topbarchat"]:sendClientMessage("Duel challenge has been sent to "..getPlayerName(player), client, 0, 255, 0)
                --exports.CITaccounts:invSet(acc, "totalDuels", (exports.CITaccounts:invGet(acc, "totalDuels") or 0) + 1)
            else
                exports["topbarchat"]:sendClientMessage("You've already sent a duel request to this player", client, 0, 255, 0)
            end
        else
            outputChatBox(client, "Player is offline", 255, 0, 0)
        end
    elseif (duelType == "team") then
        if (type(player) == "string") then
            local playerTeam = getPlayerDuelTeam(client)
            local team = player
            if (isPlayerDuelTeamLeader(client)) then
                if (teamList[team]) then
                    if (team ~= playerTeam) then
                        if (not duelRequests["team"][team]) then
                            duelRequests["team"][team] = {}
                        end
                        if (not duelRequests["team"][team][playerTeam]) then
                            duelRequests["team"][team][playerTeam] = {moneyAmount or 0, rules, map}
                            exports["topbarchat"]:sendClientMessage("Duel challenge has been sent to team "..team, client, 0, 255, 0)
                        else
                            exports["topbarchat"]:sendClientMessage("You've already sent a duel request to this team", client, 0, 255, 0)
                        end
                    else
                        exports["topbarchat"]:sendClientMessage("You can not challenge your own team", client, 0, 255, 0)
                    end
                else
                    exports["topbarchat"]:sendClientMessage("Team does not exist", client, 0, 255, 0)
                end
            end
        end
    end
end
addEvent("CITduel.SendDuelChallenge", true)
addEventHandler("CITduel.SendDuelChallenge", root, sendDuelChallenge)
 
function updatePlayerData(player, sDuelTeam, sDuelReq, sTeamList, showWindow)
    if (isElement(player)) then
        local account = getPlayerAccount(player)
        if (not isGuestAccount(account)) then
            local wonDuels = 0
            local lostDuels = 0
            local totalDuels = 0
            local duelTeam
            local duelReq
            local isDuelTeamLeader
            local tList
            local teamInvites
            if (sDuelTeam) then
                duelTeam = getPlayerDuelTeam(player)
                isDuelTeamLeader = isPlayerDuelTeamLeader(player)
            end
            if (sDuelReq) then
                duelReq = getPlayerDuelRequests(player)
            end
            if (sTeamList) then
                tList = teamList
                teamInvites = duelTeamInvites[player]
            end
 
            triggerLatentClientEvent(player, "CITduel.ShowWindow", player, wonDuels, lostDuels, totalDuels, duelTeam, duelReq, isDuelTeamLeader, tList, showWindow, teamInvites)
        end
    end
end
 
function rejectAllChallenges()
    local duelTeam = getPlayerDuelTeam(client)
    if (duelRequests["player"][client]) then
        duelRequests["player"][client] = nil
    end
    if (duelTeam and isPlayerDuelTeamLeader(client)) then
        duelRequests["team"][duelTeam] = nil
    end
    updatePlayerData(client, false, true, false, false)
end
addEvent("CITduel.RejectAllChallenges", true)
addEventHandler("CITduel.RejectAllChallenges", root, rejectAllChallenges)
 
function rejectChallenge(src, dtype)
    if (dtype == "Single Duel") then
        if (isElement(src)) then
            duelRequests["player"][client][src] = nil
        else
            for k, v in pairs(duelRequests["player"][client]) do
                if (not isElement(k)) then
                    duelRequests["player"][client][k] = nil
                end
            end
        end
    else
        local duelTeam = getPlayerDuelTeam(client)
        if (duelTeam and isPlayerDuelTeamLeader(client) and duelRequests["team"][duelTeam]) then
            duelRequests["team"][duelTeam][src] = nil
        end
    end
    updatePlayerData(client, false, true, false, false)
end
addEvent("CITduel.RejectChallenge", true)
addEventHandler("CITduel.RejectChallenge", root, rejectChallenge)
 
function acceptDuelChallenge(src, dtype)
    if (dtype == "Single Duel") then
        if (not isElement(src)) then return end
        if (duelRequests["player"][client][src]) then
            local tempData = duelRequests["player"][client][src]
            local ptable = {client, src}
            duelRequests["player"][client][src] = nil
            for k, v in ipairs(ptable) do
                local playerCanDuel, errMsg = canPlayerDuel(v, {tempData[1]})
                if (not playerCanDuel) then
                    for key, val in ipairs(ptable) do
                        if (val ~= v) then
                            exports["topbarchat"]:sendClientMessage(getPlayerName(v).." won't participate in this duel because: "..errorMessages[errMsg][1], val, 255, 0, 0)
                            exports["topbarchat"]:sendClientMessage("Duel has been aborted", val, 255, 0, 0)
                       
Link to comment

كلينت

scrollPaneCats = { 
    [1] = {"Allow the following weapons", "Allowed weapons"},
    [2] = {"Allow the following drugs", "Allowed drugs"},
    [3] = {"Other", "Other"},
}
 
scrollPaneChecks = {
    [1] = {"Slot 1: Knife/Katana/Shovel...", 1, true},
    [2] = {"Slot 2: Pistol/Silenced Pistol/Desert Eagle", 1, true},
    [3] = {"Slot 3: Shotgun/Sawn-Off/Combat Shotgun", 1, true},
    [4] = {"Slot 4: Uzi/MP5/Tec-9", 1, true},
    [5] = {"Slot 5: AK-47/M4", 1, true},
    [6] = {"Slot 6: Country Rifle/Sniper Rifle", 1, true},
    [7] = {"Slot 7: Minigun", 1, true},
    [8] = {"Slot 8: Grenades/Satchels/Molotov...", 1, true},
    [9] = {"LSD", 2, true},
    [10] = {"Weed", 2, true},
    [11] = {"Speed", 2, true},
    [12] = {"God", 2, true},
    [13] = {"Steroids", 2, true},
    [14] = {"Heroin", 2, true},
    [15] = {"Allow med-kits", 3, true},
    [16] = {"Friendly Fire", 3, true, true},
    [17] = {"Allow Armor", 3, true},
}
 
pCheckBoxes = {}
tCheckBoxes = {}
 
function makeDuelGUI()
    --------------------------------------------------------------------------------------------------------
    --------------------------------------------------------------------------------------------------------
    --------------------------------------------- Main Window ----------------------------------------------
    --------------------------------------------------------------------------------------------------------
    --------------------------------------------------------------------------------------------------------
    local rx, ry = guiGetScreenSize()
   
    duelWindow = guiCreateWindow((rx/2) - 333, (ry/2) - 263, 667, 525, "Duel System Interface", false)
    guiWindowSetSizable(duelWindow, false)
    guiSetAlpha(duelWindow, 1.00)
 
    closeWindowButton = guiCreateButton(388, 22, 268, 27, "Close Window", false, duelWindow)
 
    -- Labels
    wonDuelsDescLabel = guiCreateLabel(13, 25, 63, 15, "Won duels:", false, duelWindow)
    lostDuelsDescLabel = guiCreateLabel(130, 25, 63, 15, "Lost duels:", false, duelWindow)
    receivedDuelsDescLabel = guiCreateLabel(247, 25, 92, 15, "Received duels:", false, duelWindow)
    wonDuelsLabel = guiCreateLabel(79, 25, 36, 15, "9999", false, duelWindow)
    lostDuelsLabel = guiCreateLabel(197, 25, 36, 15, "9998", false, duelWindow)
    receivedDuelsLabel = guiCreateLabel(344, 25, 36, 15, "9997", false, duelWindow)
 
    guiSetFont(wonDuelsDescLabel, "default-bold-small")
    guiSetFont(lostDuelsDescLabel, "default-bold-small")
    guiSetFont(receivedDuelsDescLabel, "default-bold-small")
    guiLabelSetColor(wonDuelsDescLabel, 0, 255, 0)
    guiLabelSetColor(lostDuelsDescLabel, 255, 0, 0)
    guiLabelSetColor(receivedDuelsDescLabel, 255, 255, 0)
    guiLabelSetHorizontalAlign(wonDuelsDescLabel, "center", false)
    guiLabelSetHorizontalAlign(lostDuelsDescLabel, "center", false)
    guiLabelSetHorizontalAlign(receivedDuelsDescLabel, "center", false)
    guiLabelSetVerticalAlign(wonDuelsDescLabel, "center")
    guiLabelSetVerticalAlign(wonDuelsLabel, "center")
    guiLabelSetVerticalAlign(lostDuelsDescLabel, "center")
    guiLabelSetVerticalAlign(lostDuelsLabel, "center")
    guiLabelSetVerticalAlign(receivedDuelsDescLabel, "center")
    guiLabelSetVerticalAlign(receivedDuelsLabel, "center")
 
    challengesTabPanel = guiCreateTabPanel(9, 47, 649, 469, false, duelWindow)
   
    --Event Handlers
   
    addEventHandler("onClientGUIClick", closeWindowButton, closeMainWindow, false)
 
    -------------------------------------------------------------------------------------------------------
    ---------------------------------------- Challenge Player/Team ----------------------------------------
    -------------------------------------------------------------------------------------------------------
 
    challengePlayerTeamTab = guiCreateTab("Challenge a player/team", challengesTabPanel)
    duelTypeTabPanel = guiCreateTabPanel(1, 4, 648, 440, false, challengePlayerTeamTab)
   
    -------------------------------------------- Single Duel ----------------------------------------------
 
    singleDuelTab = guiCreateTab("Single Duel", duelTypeTabPanel)
 
    challengePlayerButton = guiCreateButton(257, 369, 304, 39, "Challenge selected player", false, singleDuelTab)
 
    mapSelectionPlayerDuel = guiCreateComboBox(468, 14, 135, 99, "Default Map", false, singleDuelTab)
    for k, v in pairs(mapObjects) do
        if (not v["OnlyTeams"]) then
            guiComboBoxAddItem(mapSelectionPlayerDuel, k)
        end
    end
 
    duelMoneyDescLabelP = guiCreateLabel(224, 16, 134, 17, "Money amount to bet:", false, singleDuelTab)
    duelRulesDescLabelP = guiCreateLabel(240, 44, 343, 19, "Duel Rules", false, singleDuelTab)
    guiLabelSetHorizontalAlign(duelRulesDescLabelP, "center", false)
    guiLabelSetHorizontalAlign(duelMoneyDescLabelP, "center", false)
    guiLabelSetVerticalAlign(duelRulesDescLabelP, "center")
    guiLabelSetVerticalAlign(duelMoneyDescLabelP, "center")
 
    playerSearchP = guiCreateEdit(8, 8, 179, 21, "", false, singleDuelTab)
    moneyEditP = guiCreateEdit(359, 15, 99, 20, "", false, singleDuelTab)
 
    playersGridListP = guiCreateGridList(7, 31, 180, 380, false, singleDuelTab)
    guiGridListSetSortingEnabled(playersGridListP, false)
    guiGridListAddColumn(playersGridListP, "Name", 1)
 
    scrollPaneP = guiCreateScrollPane(263, 69, 287, 298, false, singleDuelTab)
   
    exports.CITnvremisc:setEditOnlyNumbers(moneyEditP, true, true, true)
   
    local count1 = 1
    for k, v in ipairs(scrollPaneCats) do
        guiLabelSetHorizontalAlign(guiCreateLabel(0, count1*25 - 10, 270, 17, "_________________________________________________________________", false, scrollPaneP), "center", false)
        guiLabelSetHorizontalAlign(guiCreateLabel(0, count1*25 + 5, 270, 17, v[1], false, scrollPaneP), "center", false)
        count1 = count1 + 1
        for i, val in ipairs(scrollPaneChecks) do
            if (val[2] == k and not val[4]) then
                pCheckBoxes[i] = guiCreateCheckBox(0, count1*25, 287, 17, val[1], val[3], false, scrollPaneP)
                count1 = count1 + 1
            end
        end
    end
    for k,v in ipairs(getElementsByType("player")) do
        if (v ~= localPlayer) then
            local row = guiGridListAddRow(playersGridListP)
            guiGridListSetItemText(playersGridListP, row, 1, getPlayerName(v), false, false)
            guiGridListSetItemData(playersGridListP, row, 1, v)
        end
    end
   
    addEventHandler("onClientPlayerJoin", root, onPlayerJoin)
    addEventHandler("onClientPlayerQuit", root, onPlayerQuit)
    addEventHandler("onClientPlayerChangeNick", root, onPlayerNameChange)
   
    addEventHandler("onClientGUIChanged", playerSearchP, search, false)
   
    addEventHandler("onClientGUIClick", challengePlayerButton, sendDuelChallenge, false)
 
    -------------------------------------------- Team Duel ----------------------------------------------
 
    teamDuelTab = guiCreateTab("Teams Duel", duelTypeTabPanel)
 
    moneyEditT = guiCreateEdit(359, 15, 99, 20, "", false, teamDuelTab)
 
    teamsGridListT = guiCreateGridList(8, 31, 156, 174, false, teamDuelTab)
    guiGridListSetSortingEnabled(teamsGridListT, false)
    guiGridListAddColumn(teamsGridListT, "Team Name", 1)
    playersGridListT = guiCreateGridList(8, 232, 156, 174, false, teamDuelTab)
    guiGridListSetSortingEnabled(playersGridListT, false)
    guiGridListAddColumn(playersGridListT, "Name", 1)
 
    scrollPaneT = guiCreateScrollPane(353, 101, 290, 269, false, teamDuelTab)
   
    exports.CITnvremisc:setEditOnlyNumbers(moneyEditT, true, true, true)
   
    local count2 = 1
    for k, v in ipairs(scrollPaneCats) do
        guiLabelSetHorizontalAlign(guiCreateLabel(0, count2*25 - 10, 270, 17, "_________________________________________________________________", false, scrollPaneT), "center", false)
        guiLabelSetHorizontalAlign(guiCreateLabel(0, count2*25 + 5, 270, 17, v[1], false, scrollPaneT), "center", false)
        count2 = count2 + 1
        for i, val in ipairs(scrollPaneChecks) do
            if (val[2] == k) then
                tCheckBoxes[i] = guiCreateCheckBox(0, count2*25, 287, 17, val[1], val[3], false, scrollPaneT)
                count2 = count2 + 1
            end
        end
    end
       
    comboBoxT = guiCreateComboBox(468, 14, 135, 99, "Default Map", false, teamDuelTab)
    for k, v in pairs(mapObjects) do
        if (not v["OnlySingle"]) then
            guiComboBoxAddItem(comboBoxT, k)
        end
    end
 
    challengeTeamButton = guiCreateButton(360, 371, 271, 36, "Challenge selected team", false, teamDuelTab)
    leaveTeamButton = guiCreateButton(450, 41, 90, 30, "Leave Team", false, teamDuelTab)
    createTeamButton = guiCreateButton(547, 41, 90, 30, "Create Team", false, teamDuelTab)
    viewTeamInvites = guiCreateButton(352, 41, 90, 30, "View my team invites", false, teamDuelTab)
 
    teamListLabel = guiCreateLabel(11, 6, 145, 21, "Team List", false, teamDuelTab)
    teamPlayersLabel = guiCreateLabel(13, 209, 145, 17, "Players in team", false, teamDuelTab)
    moneyAmountDescLabelT = guiCreateLabel(224, 16, 134, 17, "Money amount to bet:", false, teamDuelTab)
    currentTeamLabel = guiCreateLabel(167, 47, 182, 17, "My current team: None", false, teamDuelTab)
    duelRulesDescLabelT = guiCreateLabel(388, 75, 211, 19, "Duel Rules", false, teamDuelTab)
    descLabelT = guiCreateLabel(168, 67, 180, 343, "Only the team leader will be able to challenge other teams and accept challenges from other teams. Usually the leader is the one who created the team\n\nThe money that your team win will be split amongst all members. Though before starting the duel, the money bet will be taken from the team leader\n\nIf you reconnect you'll be auto-kicked from the team. In case you are the team leader., a random member will be designed as new leader.", false, teamDuelTab)
 
    guiLabelSetVerticalAlign(duelRulesDescLabelT, "center")
    guiLabelSetVerticalAlign(descLabelT, "center")
    guiLabelSetVerticalAlign(currentTeamLabel, "center")
    guiLabelSetVerticalAlign(moneyAmountDescLabelT, "center")
    guiLabelSetVerticalAlign(teamListLabel, "center")
    guiLabelSetVerticalAlign(teamPlayersLabel, "center")
    guiLabelSetHorizontalAlign(teamListLabel, "center", false)
    guiLabelSetHorizontalAlign(teamPlayersLabel, "center", false)
    guiLabelSetHorizontalAlign(moneyAmountDescLabelT, "center", false)
    guiLabelSetHorizontalAlign(currentTeamLabel, "center", false)
    guiLabelSetHorizontalAlign(descLabelT, "center", true)
    guiLabelSetHorizontalAlign(duelRulesDescLabelT, "center", false)
   
    addEventHandler("onClientGUIClick", teamsGridListT, onTeamGridListClick, false)
    addEventHandler("onClientGUIClick", viewTeamInvites, onInviteClick, false)
    addEventHandler("onClientGUIClick", challengeTeamButton, sendDuelChallenge, false)
    addEventHandler("onClientGUIClick", createTeamButton, createDuelTeam, false)
    addEventHandler("onClientGUIClick", leaveTeamButton, function() exports.CITnvremisc:createYesNoWindow("CITduel.LeaveDuelTeam", nil, "Leave Duel Team", "Are you sure you want to leave this team?", true, true) end, false)
 
    -------------------------------------------------------------------------------------------------------
    ---------------------------------------- Received Challenges ------------------------------------------
    -------------------------------------------------------------------------------------------------------
 
    receivedChallengesTab = guiCreateTab("Received Challenges", challengesTabPanel)
 
    challengesDescLabel = guiCreateLabel(20, 20, 614, 20, "Challenges List", false, receivedChallengesTab)
    guiLabelSetHorizontalAlign(challengesDescLabel, "center", false)
    guiLabelSetVerticalAlign(challengesDescLabel, "center")
 
    recChallengesGridList = guiCreateGridList(6, 59, 636, 326, false, receivedChallengesTab)
    guiGridListSetSortingEnabled(recChallengesGridList, false)
    guiGridListAddColumn(recChallengesGridList, "Challenger Name", 0.4)
    guiGridListAddColumn(recChallengesGridList, "Money Bet", 0.1)
    guiGridListAddColumn(recChallengesGridList, "Duel Type", 0.2)
    guiGridListAddColumn(recChallengesGridList, "Duel Map", 0.2)
 
    acceptChallengeButton = guiCreateButton(7, 393, 203, 37, "Accept Challenge", false, receivedChallengesTab)
    rejectAllChallengesButton = guiCreateButton(439, 393, 203, 37, "Reject All Challenges", false, receivedChallengesTab)
    rejectChallengeButton = guiCreateButton(223, 393, 203, 37, "Reject Challenge", false, receivedChallengesTab)
   
    addEventHandler("onClientGUIClick", acceptChallengeButton, showDuelRules, false)
    addEventHandler("onClientGUIClick", rejectChallengeButton, rejectChallenge, false)
    addEventHandler("onClientGUIClick", rejectAllChallengesButton, function() triggerServerEvent("CITduel.RejectAllChallenges", root) end, false)
   
    -------------------------------------------------------------------------------------------------------
    ---------------------------------------- Duel Info Window ---------------------------------------------
    -------------------------------------------------------------------------------------------------------
   
    duelInfoWnd = guiCreateWindow((rx/2) - 164, (ry/2) - 190, 318, 381, "Duel Info", false)
    guiWindowSetSizable(duelInfoWnd, false)
    guiSetVisible(duelInfoWnd, false)
    guiSetAlpha(duelInfoWnd, 1.00)
 
    descLabelInfoWnd = guiCreateLabel(16, 22, 285, 17, "Rules of this duel:", false, duelInfoWnd)
    guiLabelSetHorizontalAlign(descLabelInfoWnd, "center", false)
    guiLabelSetVerticalAlign(descLabelInfoWnd, "center")
    infoWndScrollPane = guiCreateScrollPane(9, 46, 300, 282, false, duelInfoWnd)
    beginDuel = guiCreateButton(9, 337, 143, 35, "Accept", false, duelInfoWnd)
    closeDuelInfoWnd = guiCreateButton(166, 337, 143, 35, "Cancel", false, duelInfoWnd)
   
    addEventHandler("onClientGUIClick", closeDuelInfoWnd, closeInfoWindow, false)
    addEventHandler("onClientGUIClick", beginDuel, acceptDuelChallenge, false)
   
   
Link to comment
الوحة قبل ما ابدل

(getPlayerMoney(leader1)

ب

(getElementData(source, "Money") or 0)

تفتح ب duel في اف 8

شي طبيعي ما يشتغل لانك جايب العيد بالأقواس و الأرقمنت

و ما اعتقد انهم ناشرين مودهم CIT و عموماً الواضح من الكود انه تبع

إذا ناشرين مودهم، اثبت ذلك

إذا اعطوك تصريح بأستخدام مودهم، اثبت ذلك

وإلا سيتم إغلاق الموضوع

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