Jump to content

ابي مساعده والله صار لي ثلاثه اسابيع يمكن وانا احاول


Recommended Posts

انا ابي الديث ماتش يشتغل بزر يعني الاعب الي يضغط على الزر يخش الديث ماتش

وتجيه اسماء التيمات وعدد القتل ويحمل الماب

والي ما ضغط على الزر ما يجيه شي لا تجيه المابات ولا تجيه اسماء التيمات

ولا يقدر يشوف الي في الديث ماتش

وهذا المود

http://up.top4top.net/downloadf-130aexf1-zip.html :redhotevil:

Link to comment

استخدم العوالم الوهمية

يعني لما يضغط زر الديث ماتش يحطه بعالم وهمي

وعدل ع السكربت وسو تحقق من العالم الوهمي اذا كان يساوي العالم الوهمي الي حطيته للديث ماتش سو له الوظيفة

Link to comment
استخدم العوالم الوهمية

يعني لما يضغط زر الديث ماتش يحطه بعالم وهمي

وعدل ع السكربت وسو تحقق من العالم الوهمي اذا كان يساوي العالم الوهمي الي حطيته للديث ماتش سو له الوظيفة

انا اعرف انقل الاعب الى عالم وهمي لكن كيف احدد العالم الوهمي للديث ماتش وماباته

Edited by Guest
Link to comment

عدل ع القيم اذا ما كان مشفر

أعتقد ان في وظيفة في القيم مود ترسبن اللاعب بالماب انت سو تحقق للعالم الوهمي قبل لايرسبنه باستخدام الوظيفة

Link to comment
عدل ع القيم اذا ما كان مشفر

أعتقد ان في وظيفة في القيم مود ترسبن اللاعب بالماب انت سو تحقق للعالم الوهمي قبل لايرسبنه باستخدام الوظيفة

المشكله اعتقد هنا

لان هاذي الوظيفه تشتغل اول ما يشتغل الماب

function onMapLoad ( name ) 
  
    --outputChatBox ( "LOADING NEW MAP... PLEASE WAIT" ) 
  
    mapResource = getResourceRootElement(name)   
     
    if xDebug then outputDebugString ( "Starting TDMA Main Control Suite" ) end 
    if xDebug then outputDebugString ( "STARTED... Proceeding to load gamemode... WAIT!" ) end 
     
    ----outputDebugString ( "Setting up Bases" ) 
    setupBases(name) 
         
    setGameType ("Team Death Match Arena") 
     
    tdma = createElement("tdmagame") 
     
    versionDisplay = textCreateDisplay () 
     
    if ( tonumber(gameMaxKills) > 0 ) then 
    local teamText = textCreateTextItem ( "Scores", 0.80, 0.96 + textBoost, "medium", 255,255,255, 255, 1.2 ) 
    textDisplayAddText ( versionDisplay, teamText ) 
    textBoost = textBoost + 0.01 
        for k,v in ipairs(gameTeams) do 
            if xDebug2 then outputDebugString ( "**MAKING TEAM KILL TEXTS***" ) end 
            if xDebug2 then outputDebugString ( "**GOT: " .. v.name .. " R:" .. v.red .. " G:" .. v.green .. " B:" .. v.blue ) end 
            local teamName = v.name 
            local teamKills = v.kills 
             
            teamText = textCreateTextItem ( teamName .. ": " .. teamKills .. "/" .. gameMaxKills .. "kills",0.00+ textBoost, 0.96, "medium", tonumber(v.red), tonumber(v.green), tonumber(v.blue), 255, 1.2) 
            --setElementParent ( teamText, tdma ) 
  
  
            v.teamText = teamText 
            textDisplayAddText ( versionDisplay, teamText ) 
            textBoost = textBoost + 0.25 
        end 
    end 
     
     
    for k,v in ipairs(gameTeams) do 
        if ( gameFF == "on" ) then 
            setTeamFriendlyFire ( v.team, true ) 
            setTeamFriendlyFire ( v.team, true ) 
        else 
            setTeamFriendlyFire ( v.team, false ) 
            setTeamFriendlyFire ( v.team, false ) 
        end 
    end 
     
    --Start the pickup system from Included\pickup_system.lua 
    initPickupSystem() 
    --Start the vehicle system from Included\vehicle_system.lua 
    initVehicleSystem() 
     
    ----outputDebugString ( "Starting The Game" ) 
    if xDebug then outputDebugString ( "[[[[[/*****STARTING GAME*****\]]]]]" ) end 
    startGame() 
  
end 
addEventHandler( "onGamemodeMapStart", root, onMapLoad) 

انا حاولت اخلها تشتغل عند الاعب الي يضغط الزر ما قدرت

اذا اشتغلت اشتغلت عند الاعبين كلهم

Link to comment
  
setElementPosition 
setElementInterior 
setElementDimension 
  
  

انا فهمت هاذي

setElementDimension 

لكن ماني فاهم ذي وش تسوي

setElementPosition 
setElementInterior 

انتظركم

Edited by Guest
Link to comment
الي سويتها الي فيها زر الديث ماتش GUI أطرحلي أكواد الـ

تفضل

Window = { 
    button = {}, 
    staticimage = {} 
} 
  
Window.button[1] = guiCreateButton(312, 508, 148, 46, "Spawn", false) -- زر السباون 
Window.button[2] = guiCreateButton(312, 508, 148, 46, "ديث ماتش", false)--الزر الي سضغط عليه عشن يخش 
guiSetFont(Window.button[1], "clear-normal") 
Window.staticimage[1] = guiCreateStaticImage(90, 273, 132, 70, "1.png", false)--سهم يمين  
Window.staticimage[2] = guiCreateStaticImage(591, 273, 132, 70, "2.png", false)   -- سهم يسار 
showCursor(true) 
  
guiSetVisible (Window.button[1], false) 
guiSetVisible (Window.staticimage[1], false) 
guiSetVisible (Window.staticimage[2], false) 
  

Link to comment
؟tdma_core_client.lua اللوحة ذي ماهي الموجودة في ملف

قصدي أنت تبي اللوحة الي طرحتها لي للدخول للديث ماتش واللوحة الي بالملف لتغيير التيم؟

لا انا عدلتها يوم طلبتني اكواد gui

لاني انا كنت مسويها من قبل بس عصبت وسويت استبدال للمود

الحين بطرح لك اكواد tdma_core_client.lua ككلها

معليك ماهي مرتبه الاكواد وفيها اخطأ انا اضبطها بعدين

  
   
    function data() 
        l1, l2, l3 = getTeamColor ( getPlayerTeam( getLocalPlayer() ) ) 
        dxDrawRectangle(0, 570, 799, 30, tocolor(0, 0, 0, 63), false) 
        dxDrawLine(0, 570, 798, 570, tocolor(40, 248, 0, 254), 2, true) 
        dxDrawLine(0, 600, 798, 600, tocolor(40, 248, 0, 254), 2, true) 
        dxDrawText("VS", 145, 574, 172, 595, tocolor(0, 239, 254, 249), 1, "default-bold", "center", "center", false, false, true, false, false) 
        dxDrawText("Your Team :", 363, 577, 434, 595, tocolor(255, 0, 0, 255), 1, "default-bold", "center", "center", false, false, true, false, false) 
        dxDrawText(getTeamName(getPlayerTeam( getLocalPlayer() )), 434, 577, 481, 595, tocolor(l1, l2, l3, 255), 1, "default-bold", "left", "center", false, false, true, false, false) 
        dxDrawText("Ping:"..getPlayerPing(getLocalPlayer()), 538, 577, 594, 595, tocolor(1, 211, 249, 255), 1, "default-bold", "left", "center", false, false, true, false, false) 
        end 
     
  
  
  
  
local guiTextLabel = nil 
local guiTextLabelTeamName = nil 
local guiTextLabelText = nil 
  
  
  
showCursor(true) 
function onClientPlayerSpawn() 
    --outputChatBox ( "Ive Loaded, contacting server!" ) 
    triggerServerEvent ( "Event_clientScriptLoaded", getRootElement(), getLocalPlayer() ) 
end 
  
  
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), onClientPlayerSpawn ) 
  
Window = { 
    button = {}, 
    staticimage = {} 
} 
  
Window.button[1] = guiCreateButton(312, 508, 148, 46, "Spawn", false) 
Window.button[2] = guiCreateButton(312, 508, 148, 46, "ديث ماتش", false) 
guiSetFont(Window.button[1], "clear-normal") 
Window.staticimage[1] = guiCreateStaticImage(90, 273, 132, 70, "1.png", false) 
Window.staticimage[2] = guiCreateStaticImage(591, 273, 132, 70, "2.png", false)    
showCursor(true) 
  
guiSetVisible (Window.button[1], false) 
guiSetVisible (Window.staticimage[1], false) 
guiSetVisible (Window.staticimage[2], false) 
  
addEventHandler ( "onClientGUIClick", root, function() 
guiSetVisible (Window.button[1], true) 
guiSetVisible (Window.staticimage[1], true) 
guiSetVisible (Window.staticimage[2], true) 
guiSetVisible (Window.button[2], false) 
addEventHandler("onClientRender", root,data) 
addEventHandler("onClientRender", root,teamName) 
triggerEvent ( "ShowChangeTeamWindow", getLocalPlayer(), getLocalPlayer() ) 
  
end) 
  
  
  
  
  
  
  
  
function ShowChangeTeamWindow(player)  
if player == localPlayer then 
ThePed = createPed(104, 2255.28931 ,-2533.50260 ,10.88063,90) 
if getElementData ( player, "tdma.teamid" ) == 1 then 
setElementModel(ThePed,getElementData(localPlayer,"TeamOneSkin")) 
  
else 
setElementModel(ThePed,getElementData(localPlayer,"TeamTwoSkin")) 
end 
  
  addEventHandler("onClientRender", root,teamName) 
  
setCameraMatrix(2251.31689 ,-2533.50806, 11.39995, 2260.31689 ,-2533.50806, 10.39995) 
guiSetVisible (Window.button[1], true) 
guiSetVisible (Window.staticimage[1], true) 
guiSetVisible (Window.staticimage[2], true) 
bindKey ( "arrow_l", "down", ChangeTeamInWindow ) 
bindKey ( "arrow_r", "down", ChangeTeamInWindow ) 
bindKey ( "enter", "down", SpawnBind ) 
showCursor(true) 
fadeCamera (true) 
end 
end 
addEvent ( "ShowChangeTeamWindow", true ) 
addEventHandler ( "ShowChangeTeamWindow", root,ShowChangeTeamWindow) 
  
  
function ChangeTeam() 
outputChatBox("Wait 3 second to change your team !!", localPlayer) 
  
setTimer( 
function() 
triggerEvent ( "ShowChangeTeamWindow", getLocalPlayer(), getLocalPlayer() ) 
end,3000,1 
) 
end 
bindKey ( "F3", "down", ChangeTeam ) 
  
function ChangeTeamInWindow() 
triggerServerEvent ( "ChangeWindowStats", getLocalPlayer(), getLocalPlayer() ) 
fxAddTankFire(834.3203125,-2067.7939453125,12.978555679321, 0, 90, 0) 
skin = 22 
end 
bindKey ( "arrow_l", "down", ChangeTeamInWindow ) 
bindKey ( "arrow_r", "down", ChangeTeamInWindow ) 
function SpawnBind() 
triggerServerEvent ( "ChangeWindowStats", getLocalPlayer(), getLocalPlayer() ) 
triggerServerEvent ( "spawnThePlayerW", getLocalPlayer(), getLocalPlayer() ) 
  removeEventHandler("onClientRender", root,teamName) 
----------------------------------------------------------------------------- 
guiSetVisible (Window.button[1], false) 
guiSetVisible (Window.staticimage[1], false) 
guiSetVisible (Window.staticimage[2], false) 
unbindKey ( "enter", "down", SpawnBind ) 
unbindKey ( "arrow_l", "down", ChangeTeamInWindow ) 
unbindKey ( "arrow_r", "down", ChangeTeamInWindow ) 
showCursor(false) 
  
end 
bindKey ( "enter", "down", SpawnBind ) 
function OnClick() 
if ( source == Window.staticimage[1] ) then 
triggerServerEvent ( "ChangeWindowStats", getLocalPlayer(), getLocalPlayer() ) 
fxAddTankFire(834.3203125,-2067.7939453125,12.978555679321, 0, 90, 0) 
  
elseif ( source == Window.staticimage[2] ) then 
triggerServerEvent ( "ChangeWindowStats", getLocalPlayer(), getLocalPlayer() ) 
fxAddTankFire(834.3203125,-2067.7939453125,12.978555679321, 0, 90, 0) 
  
elseif ( source == Window.button[1] ) then 
triggerServerEvent ( "ChangeWindowStats", getLocalPlayer(), getLocalPlayer() ) 
triggerServerEvent ( "spawnThePlayerW", getLocalPlayer(), getLocalPlayer() ) 
removeEventHandler("onClientRender", root,teamName) 
  
  
guiSetVisible (Window.button[1], false) 
guiSetVisible (Window.staticimage[1], false) 
guiSetVisible (Window.staticimage[2], false) 
unbindKey ( "enter", "down", SpawnBind ) 
unbindKey ( "arrow_l", "down", ChangeTeamInWindow ) 
unbindKey ( "arrow_r", "down", ChangeTeamInWindow ) 
showCursor(false) 
end 
end 
addEventHandler ( "onClientGUIClick", root, OnClick) 
  
g = 0 
b = 2.5 
function teamName () 
  dxDrawText("{ Grove }", 284, 58, 527, 111, tocolor(0, 254, 17, 255), g, "bankgothic", "center", "center", false, false, true, false, false) 
  dxDrawText("{ balla }", 284, 58, 527, 111, tocolor(215, 0, 200, 255), b, "bankgothic", "center", "center", false, false, true, false, false) 
  
end 
  
  
addEvent ( "skinUpdate", true ) 
addEventHandler ( "skinUpdate", root, 
function (player)  
if player == localPlayer then 
if getElementData ( player, "tdma.teamid" ) == 1 then 
setElementModel(ThePed,getElementData(localPlayer,"TeamOneSkin")) 
setElementModel (ThePed,106) 
g = 2.5 
b = 0 
else 
setElementModel(ThePed,getElementData(localPlayer,"TeamTwoSkin")) 
setElementModel (ThePed,104) 
g = 0 
b = 2.5 
end 
end 
end 
) 
  
---------------1skin------------------- 
txd = engineLoadTXD("106.txd") 
engineImportTXD(txd, 106) 
dff = engineLoadDFF("106.dff", 106) 
engineReplaceModel(dff, 106) 
-------------------------------------- 
txd = engineLoadTXD("104.txd") 
engineImportTXD(txd, 104) 
dff = engineLoadDFF("104.dff", 104) 
engineReplaceModel(dff, 104) 

Link to comment

بعد ما عدلت زي ما قلت يا سفاح

tdma_core_client.lua

    function data() 
        l1, l2, l3 = getTeamColor ( getPlayerTeam( getLocalPlayer() ) ) 
        dxDrawRectangle(0, 570, 799, 30, tocolor(0, 0, 0, 63), false) 
        dxDrawLine(0, 570, 798, 570, tocolor(40, 248, 0, 254), 2, true) 
        dxDrawLine(0, 600, 798, 600, tocolor(40, 248, 0, 254), 2, true) 
        dxDrawText("VS", 145+40, 574, 172, 595, tocolor(0, 239, 254, 249), 1, "default-bold", "center", "center", false, false, true, false, false) 
        dxDrawText("Your Team :", 363, 577, 434, 595, tocolor(255, 0, 0, 255), 1, "default-bold", "center", "center", false, false, true, false, false) 
        dxDrawText(getTeamName(getPlayerTeam( getLocalPlayer() )), 434, 577, 481, 595, tocolor(l1, l2, l3, 255), 1, "default-bold", "left", "center", false, false, true, false, false) 
        dxDrawText("Ping:"..getPlayerPing(getLocalPlayer()), 538, 577, 594, 595, tocolor(1, 211, 249, 255), 1, "default-bold", "left", "center", false, false, true, false, false) 
        end 
  
function onClientPlayerSpawn() 
    triggerServerEvent ( "Event_clientScriptLoaded", getRootElement(), getLocalPlayer() ) 
end 
  
  
Window = { 
    button = {}, 
    staticimage = {} 
} 
Window.button[1] = guiCreateButton(312, 508, 148, 46, "Spawn", false) 
Window.button[2] = guiCreateButton(312, 508, 148, 46, "ديث ماتش", false) 
guiSetFont(Window.button[1], "clear-normal") 
Window.staticimage[1] = guiCreateStaticImage(90, 273, 132, 70, "1.png", false) 
Window.staticimage[2] = guiCreateStaticImage(591, 273, 132, 70, "2.png", false)     
guiSetVisible (Window.button[1], false) 
guiSetVisible (Window.staticimage[1], false) 
guiSetVisible (Window.staticimage[2], false) 
  
  
ThePed = createPed(getElementData(localPlayer,"TeamOneSkin"), 2255.28931 ,-2533.50260 ,10.88063,90) 
  
function ShowChangeTeamWindow(player)  
if player == localPlayer then 
addEventHandler ( "onClientPlayerSpawn", getLocalPlayer(), onClientPlayerSpawn ) 
addEventHandler("onClientRender", root,data) 
addEventHandler("onClientRender", root,teamName) 
setCameraMatrix(2251.31689 ,-2533.50806, 11.39995, 2260.31689 ,-2533.50806, 10.39995) 
guiSetVisible (Window.button[1], true) 
guiSetVisible (Window.staticimage[1], true) 
guiSetVisible (Window.staticimage[2], true) 
showCursor(true) 
fadeCamera (true) 
end 
end 
addEvent ( "ShowChangeTeamWindow", true ) 
addEventHandler ( "ShowChangeTeamWindow", root,ShowChangeTeamWindow) 
  
  
function OnClick() 
if ( source == Window.staticimage[1] ) then 
triggerServerEvent ( "ChangeWindowStats", getLocalPlayer(), getLocalPlayer() ) 
  
elseif ( source == Window.staticimage[2] ) then 
triggerServerEvent ( "ChangeWindowStats", getLocalPlayer(), getLocalPlayer() ) 
  
elseif ( source == Window.button[1] ) then 
triggerServerEvent ( "ChangeWindowStats", getLocalPlayer(), getLocalPlayer() ) 
triggerServerEvent ( "spawnThePlayerW", getLocalPlayer(), getLocalPlayer() ) 
removeEventHandler("onClientRender", root,teamName) 
  
guiSetVisible (Window.button[1], false) 
guiSetVisible (Window.staticimage[1], false) 
guiSetVisible (Window.staticimage[2], false) 
showCursor(false) 
  
elseif ( source == Window.button[2] ) then 
triggerServerEvent ( "setDimension", getLocalPlayer() ) 
guiSetVisible (Window.button[2], false) 
end 
end 
addEventHandler ( "onClientGUIClick", root, OnClick) 
  
  
function teamName () 
if getElementData ( localPlayer, "tdma.teamid" ) == 1 then 
  dxDrawText(getElementData(localPlayer,"TeamOneName"), 284, 58, 527, 111, tocolor(getElementData(localPlayer,"TeamOneR"), getElementData(localPlayer,"TeamOneG"), getElementData(localPlayer,"TeamOneB"), 255), 2.5, "bankgothic", "center", "center", false, false, true, false, false) 
  else 
  dxDrawText(getElementData(localPlayer,"TeamTwoName"), 284, 58, 527, 111, tocolor(getElementData(localPlayer,"TeamTwoR"), getElementData(localPlayer,"TeamTwoG"), getElementData(localPlayer,"TeamTwoB"), 255), 2.5, "bankgothic", "center", "center", false, false, true, false, false) 
end 
end 
  
addEvent ( "skinUpdate", true ) 
addEventHandler ( "skinUpdate", root, 
function (player)  
if player == localPlayer then 
if getElementData ( player, "tdma.teamid" ) == 1 then 
setElementModel(ThePed,getElementData(localPlayer,"TeamOneSkin")) 
else 
setElementModel(ThePed,getElementData(localPlayer,"TeamTwoSkin")) 
end 
end 
end 
) 
  
---------------1skin------------------- 
txd = engineLoadTXD("106.txd") 
engineImportTXD(txd, 106) 
dff = engineLoadDFF("106.dff", 106) 
engineReplaceModel(dff, 106) 
-------------------------------------- 
txd = engineLoadTXD("104.txd") 
engineImportTXD(txd, 104) 
dff = engineLoadDFF("104.dff", 104) 
engineReplaceModel(dff, 104) 

tdma_core.lua

function setDimension() 
    setElementDimension ( source, 1 )
    if ( getElementDimension ( source ) == 1 ) then  
    setupBases(name)
    startGame()
    addEventHandler( "onGamemodeMapStart", root, setDimension)
    triggerClientEvent ( "ShowChangeTeamWindow", Player, Player )
   
    end
end
addEvent ( "setDimension", true )
addEventHandler ( "setDimension", root,setDimension)
 
 
function nn()
    mapResource = getResourceRootElement(name) 
   
    if xDebug then outputDebugString ( "Starting TDMA Main Control Suite" ) end
    if xDebug then outputDebugString ( "STARTED... Proceeding to load gamemode... WAIT!" ) end
   
    versionDisplay = textCreateDisplay ()
   
    if ( tonumber(gameMaxKills) > 0 ) then
    local teamText = textCreateTextItem ( "Scores", 0.80, 0.96 + textBoost, "medium", 255,255,255, 255, 1.2 )
    textDisplayAddText ( versionDisplay, teamText )
    textBoost = textBoost + 0.01
        for k,v in ipairs(gameTeams) do
            if xDebug2 then outputDebugString ( "**MAKING TEAM KILL TEXTS***" ) end
            if xDebug2 then outputDebugString ( "**GOT: " .. v.name .. " R:" .. v.red .. " G:" .. v.green .. " B:" .. v.blue ) end
            local teamName = v.name
            local teamKills = v.kills
           
            teamText = textCreateTextItem ( teamName .. ": " .. teamKills .. "/" .. gameMaxKills .. "kills",0.00+ textBoost, 0.96, "medium", tonumber(v.red), tonumber(v.green), tonumber(v.blue), 255, 1.2)
            --setElementParent ( teamText, tdma )
 
 
            v.teamText = teamText
            textDisplayAddText ( versionDisplay, teamText )
            textBoost = textBoost + 0.25
        end
    end
   
   
    for k,v in ipairs(gameTeams) do
        if ( gameFF == "on" ) then
            setTeamFriendlyFire ( v.team, true )
            setTeamFriendlyFire ( v.team, true )
        else
            setTeamFriendlyFire ( v.team, false )
            setTeamFriendlyFire ( v.team, false )
        end
    end
   
    --Start the pickup system from Included\pickup_system.lua
    initPickupSystem()
    --Start the vehicle system from Included\vehicle_system.lua
    initVehicleSystem()
   
    ----outputDebugString ( "Starting The Game" )
    if xDebug then outputDebugString ( "[[[[[/*****STARTING GAME*****\]]]]]" ) end
end
--+----------------------------+
--| Team Death Match Game Mode |
--|     Created By AlienX      |
--+----------------------------+
debugEnabled = true
 
--Game mode variables
gameInterior = 0
gameRespawnTime = 3000
gameTeams = {}
gameVehicles = {}
gameMaxKills = 40
gameFF = "off"
gameTimeHour = 0
gameTimeMin = 0
gameTimeLocked = false
versionDisplay = nil
 
xDebug = false
xDebug2 = false
textBoost = 0
 
xonPlayerWasted_Enabled = true
mapResource = nil
local tdma = nil
 
 
 
 
function onMapUnload ( name )
   
    --outputChatBox ( "UNLOADING LEVEL... PLEASE WAIT" )
   
    for k = 1,#gameTeams do
        destroyElement ( gameTeams[k].team )
    end
   
    textDestroyDisplay ( versionDisplay )
 
    --Game mode variables
    gameInterior = 0
    gameRespawnTime = 3000
    gameTeams = {}
    gameVehicles = {}
    gameMaxKills = 40
    gameFF = "off"
    gameTimeHour = 0
    gameTimeMin = 0
    gameTimeLocked = false
    versionDisplay = nil
   
   
   
    textBoost = 0
   
    xonPlayerWasted_Enabled = true
    mapResource = nil
   
    destroyElement ( tdma )
   
    for k,v in ipairs(getElementsByType("player")) do
        setPlayerTeam ( v, nil )
        setElementData ( v, "tdma.teamid", false )
        setElementData ( v, "tdma.playerHasSpawned", false )
    end
   
end
addEventHandler( "onGamemodeMapStop", root, onMapUnload)
 
 
function shuffleTable(inputData)
    local newTable = {}
    local i_RndTblPos = 0
    while #inputData > 0 do
        i_RndTblPos = math.random(1,#inputData)
        table.insert ( newTable, inputData[i_RndTblPos] )
        table.remove ( inputData, i_RndTblPos )
    end
    return newTable
end
 
function startGame()
nn()
if xDebug then outputDebugString ( "... DONE" ) end
    local playerElementTree = getElementsByType ( "player" )
    playerElementTree = shuffleTable(playerElementTree)
    for k,v in ipairs(playerElementTree) do
    local teamOne = gameTeams[1]
local teamTwo = gameTeams[2]
local randSkinPickerOne = math.random(1,#teamOne.skins)
local randSkinOne = tonumber(teamOne.skins[randSkinPickerOne].id)
local randSkinPickerTwo = math.random(1,#teamTwo.skins)
local randSkinTwo = tonumber(teamTwo.skins[randSkinPickerTwo].id)
setElementData ( v, "tdma.teamid", 1 )
setElementData(v,"TeamOneR",teamOne.red)
setElementData(v,"TeamOneG",teamOne.green)
setElementData(v,"TeamOneB",teamOne.blue)
setElementData(v,"TeamOneSkin",randSkinOne)
setElementData(v,"TeamTwoR",teamTwo.red)
setElementData(v,"TeamTwoG",teamTwo.green)
setElementData(v,"TeamTwoB",teamTwo.blue)
setElementData(v,"TeamTwoSkin",randSkinTwo)
setElementData(v,"TeamOneName", getTeamName(teamOne.team))
setElementData(v,"TeamTwoName", getTeamName(teamTwo.team))
        setElementData ( v, "tdma.sp", "n" )
        setElementData ( source, "tdma.playerHasSpawned", false )
       
        --setElementInterior ( v, 10 )
        --setTimer ( fadeCamera, 1000, 1, v, true, 1 )
       
        setPedStat ( v, 69, 1000 )
        setPedStat ( v, 70, 1000 )
        setPedStat ( v, 71, 1000 )
        setPedStat ( v, 72, 1000 )
        setPedStat ( v, 73, 1000 )
        setPedStat ( v, 74, 1000 )
        setPedStat ( v, 75, 1000 )
        setPedStat ( v, 76, 1000 )
        setPedStat ( v, 77, 1000 )
        setPedStat ( v, 78, 1000 )
        setPedStat ( v, 79, 1000 )
       
        showPlayerHudComponent ( v, "ammo", true )
        showPlayerHudComponent ( v, "area_name", true )
        showPlayerHudComponent ( v, "armour", true )
        showPlayerHudComponent ( v, "breath", true )
        showPlayerHudComponent ( v, "health", true )
        showPlayerHudComponent ( v, "money", true )
        showPlayerHudComponent ( v, "radar", true )
        showPlayerHudComponent ( v, "vehicle_name", true )
        showPlayerHudComponent ( v, "weapon", true )
       
        --Setup the status bar for the player!
        statusTextDisplay = textCreateDisplay ()
        local statusTextItem = textCreateTextItem ( "", 0.5, 0.95, "high", 255, 255, 255, 255, 1.5 )
        textDisplayAddText ( statusTextDisplay, statusTextItem )
        textDisplayAddObserver ( statusTextDisplay, v )
        textDisplayAddObserver ( versionDisplay, v )
        setElementData ( v, "tdma.status", statusTextItem )
        triggerClientEvent ( "ShowChangeTeamWindow", v, v )
        end
end
 
function restartGame()
    for k,v in ipairs(getElementsByType ( "player" )) do
        setElementData ( v, "tdma.sp", "n" )
       
        fadeCamera ( v, false, 1.0, 0, 0, 0 )
        --setElementInterior ( v, 10 )
        --setTimer ( fadeCamera, 1000, 1, v, true, 1 )
       
       
        setPedStat ( v, 69, 1000 )
        setPedStat ( v, 70, 1000 )
        setPedStat ( v, 71, 1000 )
        setPedStat ( v, 72, 1000 )
        setPedStat ( v, 73, 1000 )
        setPedStat ( v, 74, 1000 )
        setPedStat ( v, 75, 1000 )
        setPedStat ( v, 76, 1000 )
        setPedStat ( v, 77, 1000 )
        setPedStat ( v, 78, 1000 )
        setPedStat ( v, 79, 1000 )
       
        showPlayerHudComponent ( v, "ammo", true )
        showPlayerHudComponent ( v, "area_name", true )
        showPlayerHudComponent ( v, "armour", true )
        showPlayerHudComponent ( v, "breath", true )
        showPlayerHudComponent ( v, "health", true )
        showPlayerHudComponent ( v, "money", true )
        showPlayerHudComponent ( v, "radar", true )
        showPlayerHudComponent ( v, "vehicle_name", true )
        showPlayerHudComponent ( v, "weapon", true )
       
        local theTeamID = getElementData( v, "tdma.teamid" )
        local theTeam = gameTeams[theTeamID]
        if ( theTeam ) then
            respawnThePlayer ( v, theTeam )
        else
            firstSpawn ( v )
        end
    end
end
 
function onMapFinish ( name )
    if getThisResource() ~= name then return end
    for k,v in ipairs(getElementsByType("player")) do
        setElementInterior ( v, 0 )
        setCameraInterior( v, 0 )
       
Link to comment

-- لم يتم التجربة --

-- Server Side / tdma_core.lua -- 
 
function setDimension()
    setElementDimension ( source, 1 )
    setupBases(name)
    startGame()
    addEventHandler( "onGamemodeMapStart", root, setDimension)
    triggerClientEvent ( "ShowChangeTeamWindow", Player, Player )
end
addEvent ( "setDimension", true )
addEventHandler ( "setDimension", root,setDimension)
 
 
function nn()
    mapResource = getResourceRootElement(name)
   
    if xDebug then outputDebugString ( "Starting TDMA Main Control Suite" ) end
    if xDebug then outputDebugString ( "STARTED... Proceeding to load gamemode... WAIT!" ) end
   
    versionDisplay = textCreateDisplay ()
   
    if ( tonumber(gameMaxKills) > 0 ) then
    local teamText = textCreateTextItem ( "Scores", 0.80, 0.96 + textBoost, "medium", 255,255,255, 255, 1.2 )
    textDisplayAddText ( versionDisplay, teamText )
    textBoost = textBoost + 0.01
        for k,v in ipairs(gameTeams) do
            if xDebug2 then outputDebugString ( "**MAKING TEAM KILL TEXTS***" ) end
            if xDebug2 then outputDebugString ( "**GOT: " .. v.name .. " R:" .. v.red .. " G:" .. v.green .. " B:" .. v.blue ) end
            local teamName = v.name
            local teamKills = v.kills
           
            teamText = textCreateTextItem ( teamName .. ": " .. teamKills .. "/" .. gameMaxKills .. "kills",0.00+ textBoost, 0.96, "medium", tonumber(v.red), tonumber(v.green), tonumber(v.blue), 255, 1.2)
            --setElementParent ( teamText, tdma )
 
 
            v.teamText = teamText
            textDisplayAddText ( versionDisplay, teamText )
            textBoost = textBoost + 0.25
        end
    end
   
   
    for k,v in ipairs(gameTeams) do
        if ( gameFF == "on" ) then
            setTeamFriendlyFire ( v.team, true )
            setTeamFriendlyFire ( v.team, true )
        else
            setTeamFriendlyFire ( v.team, false )
            setTeamFriendlyFire ( v.team, false )
        end
    end
   
    --Start the pickup system from Included\pickup_system.lua
    initPickupSystem()
    --Start the vehicle system from Included\vehicle_system.lua
    initVehicleSystem()
   
    ----outputDebugString ( "Starting The Game" )
    if xDebug then outputDebugString ( "[[[[[/*****STARTING GAME*****\]]]]]" ) end
end
--+----------------------------+
--| Team Death Match Game Mode |
--|     Created By AlienX      |
--+----------------------------+
debugEnabled = true
 
--Game mode variables
gameInterior = 0
gameRespawnTime = 3000
gameTeams = {}
gameVehicles = {}
gameMaxKills = 40
gameFF = "off"
gameTimeHour = 0
gameTimeMin = 0
gameTimeLocked = false
versionDisplay = nil
 
xDebug = false
xDebug2 = false
textBoost = 0
 
xonPlayerWasted_Enabled = true
mapResource = nil
local tdma = nil
 
 
 
 
function onMapUnload ( name )
   
    --outputChatBox ( "UNLOADING LEVEL... PLEASE WAIT" )
   
    for k = 1,#gameTeams do
        destroyElement ( gameTeams[k].team )
    end
   
    textDestroyDisplay ( versionDisplay )
 
    --Game mode variables
    gameInterior = 0
    gameRespawnTime = 3000
    gameTeams = {}
    gameVehicles = {}
    gameMaxKills = 40
    gameFF = "off"
    gameTimeHour = 0
    gameTimeMin = 0
    gameTimeLocked = false
    versionDisplay = nil
   
   
   
    textBoost = 0
   
    xonPlayerWasted_Enabled = true
    mapResource = nil
   
    destroyElement ( tdma )
   
    for k,v in ipairs(getElementsByType("player")) do
        if getElementDimension ( v ) == 1 then
            setPlayerTeam ( v, nil )
            setElementData ( v, "tdma.teamid", false )
            setElementData ( v, "tdma.playerHasSpawned", false )
        end
    end
end
addEventHandler( "onGamemodeMapStop", root, onMapUnload)
 
 
function shuffleTable(inputData)
    local newTable = {}
    local i_RndTblPos = 0
    while #inputData > 0 do
        i_RndTblPos = math.random(1,#inputData)
        table.insert ( newTable, inputData[i_RndTblPos] )
        table.remove ( inputData, i_RndTblPos )
    end
    return newTable
end
 
function startGame()
nn()
if xDebug then outputDebugString ( "... DONE" ) end
    local playerElementTree = getElementsByType ( "player" )
    playerElementTree = shuffleTable(playerElementTree)
    for k,v in ipairs(playerElementTree) do
    if getElementDimension ( v ) == 1 then
    local teamOne = gameTeams[1]
local teamTwo = gameTeams[2]
local randSkinPickerOne = math.random(1,#teamOne.skins)
local randSkinOne = tonumber(teamOne.skins[randSkinPickerOne].id)
local randSkinPickerTwo = math.random(1,#teamTwo.skins)
local randSkinTwo = tonumber(teamTwo.skins[randSkinPickerTwo].id)
setElementData ( v, "tdma.teamid", 1 )
setElementData(v,"TeamOneR",teamOne.red)
setElementData(v,"TeamOneG",teamOne.green)
setElementData(v,"TeamOneB",teamOne.blue)
setElementData(v,"TeamOneSkin",randSkinOne)
setElementData(v,"TeamTwoR",teamTwo.red)
setElementData(v,"TeamTwoG",teamTwo.green)
setElementData(v,"TeamTwoB",teamTwo.blue)
setElementData(v,"TeamTwoSkin",randSkinTwo)
setElementData(v,"TeamOneName", getTeamName(teamOne.team))
setElementData(v,"TeamTwoName", getTeamName(teamTwo.team))
        setElementData ( v, "tdma.sp", "n" )
        setElementData ( source, "tdma.playerHasSpawned", false )
       
        --setElementInterior ( v, 10 )
        --setTimer ( fadeCamera, 1000, 1, v, true, 1 )
       
        setPedStat ( v, 69, 1000 )
        setPedStat ( v, 70, 1000 )
        setPedStat ( v, 71, 1000 )
        setPedStat ( v, 72, 1000 )
        setPedStat ( v, 73, 1000 )
        setPedStat ( v, 74, 1000 )
        setPedStat ( v, 75, 1000 )
        setPedStat ( v, 76, 1000 )
        setPedStat ( v, 77, 1000 )
        setPedStat ( v, 78, 1000 )
        setPedStat ( v, 79, 1000 )
       
        showPlayerHudComponent ( v, "ammo", true )
        showPlayerHudComponent ( v, "area_name", true )
        showPlayerHudComponent ( v, "armour", true )
        showPlayerHudComponent ( v, "breath", true )
        showPlayerHudComponent ( v, "health", true )
        showPlayerHudComponent ( v, "money", true )
        showPlayerHudComponent ( v, "radar", true )
        showPlayerHudComponent ( v, "vehicle_name", true )
        showPlayerHudComponent ( v, "weapon", true )
       
        --Setup the status bar for the player!
        statusTextDisplay = textCreateDisplay ()
        local statusTextItem = textCreateTextItem ( "", 0.5, 0.95, "high", 255, 255, 255, 255, 1.5 )
        textDisplayAddText ( statusTextDisplay, statusTextItem )
        textDisplayAddObserver ( statusTextDisplay, v )
        textDisplayAddObserver ( versionDisplay, v )
        setElementData ( v, "tdma.status", statusTextItem )
        triggerClientEvent ( "ShowChangeTeamWindow", v, v )
        end
    end
end
 
function restartGame()
    for k,v in ipairs(getElementsByType ( "player" )) do
    if getElementDimension ( v ) == 1 then
        setElementData ( v, "tdma.sp", "n" )
       
        fadeCamera ( v, false, 1.0, 0, 0, 0 )
        --setElementInterior ( v, 10 )
        --setTimer ( fadeCamera, 1000, 1, v, true, 1 )
       
       
        setPedStat ( v, 69, 1000 )
        setPedStat ( v, 70, 1000 )
        setPedStat ( v, 71, 1000 )
        setPedStat ( v, 72, 1000 )
        setPedStat ( v, 73, 1000 )
        setPedStat ( v, 74, 1000 )
        setPedStat ( v, 75, 1000 )
        setPedStat ( v, 76, 1000 )
        setPedStat ( v, 77, 1000 )
        setPedStat ( v, 78, 1000 )
        setPedStat ( v, 79, 1000 )
       
        showPlayerHudComponent ( v, "ammo", true )
        showPlayerHudComponent ( v, "area_name", true )
        showPlayerHudComponent ( v, "armour", true )
        showPlayerHudComponent ( v, "breath", true )
        showPlayerHudComponent ( v, "health", true )
        showPlayerHudComponent ( v, "money", true )
        showPlayerHudComponent ( v, "radar", true )
        showPlayerHudComponent ( v, "vehicle_name", true )
        showPlayerHudComponent ( v, "weapon", true )
       
        local theTeamID = getElementData( v, "tdma.teamid" )
        local theTeam = gameTeams[theTeamID]
            if ( theTeam ) then
                respawnThePlayer ( v, theTeam )
            else
                firstSpawn ( v )
            end
        end
    end
end
 
function onMapFinish ( name )
    if
Link to comment
-- لم يتم التجربة --
-- Server Side / tdma_core.lua -- 
 
function setDimension()
    setElementDimension ( source, 1 )
    setupBases(name)
    startGame()
    addEventHandler( "onGamemodeMapStart", root, setDimension)
    triggerClientEvent ( "ShowChangeTeamWindow", Player, Player )
end
addEvent ( "setDimension", true )
addEventHandler ( "setDimension", root,setDimension)
 
 
function nn()
    mapResource = getResourceRootElement(name)
   
    if xDebug then outputDebugString ( "Starting TDMA Main Control Suite" ) end
    if xDebug then outputDebugString ( "STARTED... Proceeding to load gamemode... WAIT!" ) end
   
    versionDisplay = textCreateDisplay ()
   
    if ( tonumber(gameMaxKills) > 0 ) then
    local teamText = textCreateTextItem ( "Scores", 0.80, 0.96 + textBoost, "medium", 255,255,255, 255, 1.2 )
    textDisplayAddText ( versionDisplay, teamText )
    textBoost = textBoost + 0.01
        for k,v in ipairs(gameTeams) do
            if xDebug2 then outputDebugString ( "**MAKING TEAM KILL TEXTS***" ) end
            if xDebug2 then outputDebugString ( "**GOT: " .. v.name .. " R:" .. v.red .. " G:" .. v.green .. " B:" .. v.blue ) end
            local teamName = v.name
            local teamKills = v.kills
           
            teamText = textCreateTextItem ( teamName .. ": " .. teamKills .. "/" .. gameMaxKills .. "kills",0.00+ textBoost, 0.96, "medium", tonumber(v.red), tonumber(v.green), tonumber(v.blue), 255, 1.2)
            --setElementParent ( teamText, tdma )
 
 
            v.teamText = teamText
            textDisplayAddText ( versionDisplay, teamText )
            textBoost = textBoost + 0.25
        end
    end
   
   
    for k,v in ipairs(gameTeams) do
        if ( gameFF == "on" ) then
            setTeamFriendlyFire ( v.team, true )
            setTeamFriendlyFire ( v.team, true )
        else
            setTeamFriendlyFire ( v.team, false )
            setTeamFriendlyFire ( v.team, false )
        end
    end
   
    --Start the pickup system from Included\pickup_system.lua
    initPickupSystem()
    --Start the vehicle system from Included\vehicle_system.lua
    initVehicleSystem()
   
    ----outputDebugString ( "Starting The Game" )
    if xDebug then outputDebugString ( "[[[[[/*****STARTING GAME*****\]]]]]" ) end
end
--+----------------------------+
--| Team Death Match Game Mode |
--|     Created By AlienX      |
--+----------------------------+
debugEnabled = true
 
--Game mode variables
gameInterior = 0
gameRespawnTime = 3000
gameTeams = {}
gameVehicles = {}
gameMaxKills = 40
gameFF = "off"
gameTimeHour = 0
gameTimeMin = 0
gameTimeLocked = false
versionDisplay = nil
 
xDebug = false
xDebug2 = false
textBoost = 0
 
xonPlayerWasted_Enabled = true
mapResource = nil
local tdma = nil
 
 
 
 
function onMapUnload ( name )
   
    --outputChatBox ( "UNLOADING LEVEL... PLEASE WAIT" )
   
    for k = 1,#gameTeams do
        destroyElement ( gameTeams[k].team )
    end
   
    textDestroyDisplay ( versionDisplay )
 
    --Game mode variables
    gameInterior = 0
    gameRespawnTime = 3000
    gameTeams = {}
    gameVehicles = {}
    gameMaxKills = 40
    gameFF = "off"
    gameTimeHour = 0
    gameTimeMin = 0
    gameTimeLocked = false
    versionDisplay = nil
   
   
   
    textBoost = 0
   
    xonPlayerWasted_Enabled = true
    mapResource = nil
   
    destroyElement ( tdma )
   
    for k,v in ipairs(getElementsByType("player")) do
        if getElementDimension ( v ) == 1 then
            setPlayerTeam ( v, nil )
            setElementData ( v, "tdma.teamid", false )
            setElementData ( v, "tdma.playerHasSpawned", false )
        end
    end
end
addEventHandler( "onGamemodeMapStop", root, onMapUnload)
 
 
function shuffleTable(inputData)
    local newTable = {}
    local i_RndTblPos = 0
    while #inputData > 0 do
        i_RndTblPos = math.random(1,#inputData)
        table.insert ( newTable, inputData[i_RndTblPos] )
        table.remove ( inputData, i_RndTblPos )
    end
    return newTable
end
 
function startGame()
nn()
if xDebug then outputDebugString ( "... DONE" ) end
    local playerElementTree = getElementsByType ( "player" )
    playerElementTree = shuffleTable(playerElementTree)
    for k,v in ipairs(playerElementTree) do
    if getElementDimension ( v ) == 1 then
    local teamOne = gameTeams[1]
local teamTwo = gameTeams[2]
local randSkinPickerOne = math.random(1,#teamOne.skins)
local randSkinOne = tonumber(teamOne.skins[randSkinPickerOne].id)
local randSkinPickerTwo = math.random(1,#teamTwo.skins)
local randSkinTwo = tonumber(teamTwo.skins[randSkinPickerTwo].id)
setElementData ( v, "tdma.teamid", 1 )
setElementData(v,"TeamOneR",teamOne.red)
setElementData(v,"TeamOneG",teamOne.green)
setElementData(v,"TeamOneB",teamOne.blue)
setElementData(v,"TeamOneSkin",randSkinOne)
setElementData(v,"TeamTwoR",teamTwo.red)
setElementData(v,"TeamTwoG",teamTwo.green)
setElementData(v,"TeamTwoB",teamTwo.blue)
setElementData(v,"TeamTwoSkin",randSkinTwo)
setElementData(v,"TeamOneName", getTeamName(teamOne.team))
setElementData(v,"TeamTwoName", getTeamName(teamTwo.team))
        setElementData ( v, "tdma.sp", "n" )
        setElementData ( source, "tdma.playerHasSpawned", false )
       
        --setElementInterior ( v, 10 )
        --setTimer ( fadeCamera, 1000, 1, v, true, 1 )
       
        setPedStat ( v, 69, 1000 )
        setPedStat ( v, 70, 1000 )
        setPedStat ( v, 71, 1000 )
        setPedStat ( v, 72, 1000 )
        setPedStat ( v, 73, 1000 )
        setPedStat ( v, 74, 1000 )
        setPedStat ( v, 75, 1000 )
        setPedStat ( v, 76, 1000 )
        setPedStat ( v, 77, 1000 )
        setPedStat ( v, 78, 1000 )
        setPedStat ( v, 79, 1000 )
       
        showPlayerHudComponent ( v, "ammo", true )
        showPlayerHudComponent ( v, "area_name", true )
        showPlayerHudComponent ( v, "armour", true )
        showPlayerHudComponent ( v, "breath", true )
        showPlayerHudComponent ( v, "health", true )
        showPlayerHudComponent ( v, "money", true )
        showPlayerHudComponent ( v, "radar", true )
        showPlayerHudComponent ( v, "vehicle_name", true )
        showPlayerHudComponent ( v, "weapon", true )
       
        --Setup the status bar for the player!
        statusTextDisplay = textCreateDisplay ()
        local statusTextItem = textCreateTextItem ( "", 0.5, 0.95, "high", 255, 255, 255, 255, 1.5 )
        textDisplayAddText ( statusTextDisplay, statusTextItem )
        textDisplayAddObserver ( statusTextDisplay, v )
        textDisplayAddObserver ( versionDisplay, v )
        setElementData ( v, "tdma.status", statusTextItem )
        triggerClientEvent ( "ShowChangeTeamWindow", v, v )
        end
    end
end
 
function restartGame()
    for k,v in ipairs(getElementsByType ( "player" )) do
    if getElementDimension ( v ) == 1 then
        setElementData ( v, "tdma.sp", "n" )
       
        fadeCamera ( v, false, 1.0, 0, 0, 0 )
        --setElementInterior ( v, 10 )
        --setTimer ( fadeCamera, 1000, 1, v, true, 1 )
       
       
        setPedStat ( v, 69, 1000 )
        setPedStat ( v, 70, 1000 )
        setPedStat ( v, 71, 1000 )
        setPedStat ( v, 72, 1000 )
        setPedStat ( v, 73, 1000 )
        setPedStat ( v, 74, 1000 )
        setPedStat ( v, 75, 1000 )
        setPedStat ( v, 76, 1000 )
        setPedStat ( v, 77, 1000 )
        setPedStat ( v, 78, 1000 )
        setPedStat ( v, 79, 1000 )
       
        showPlayerHudComponent ( v, "ammo", true )
        showPlayerHudComponent ( v, "area_name", true )
        showPlayerHudComponent ( v, "armour", true )
        showPlayerHudComponent ( v, "breath", true )
        showPlayerHudComponent ( v, "health", true )
        showPlayerHudComponent ( v, "money", true )
        showPlayerHudComponent ( v, "radar", true )
        showPlayerHudComponent ( v, "vehicle_name", true )
        showPlayerHudComponent ( v, "weapon", true )
       
        local theTeamID = getElementData( v, "tdma.teamid" )
        local theTeam = gameTeams[theTeamID]
            if ( theTeam ) then
                respawnThePlayer ( v, theTeam )
            else
                firstSpawn ( v )
            end
        end
    end
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...