Jump to content

مشكله في مود سعد عدم الحفظ


aL.Kfo

Recommended Posts

مرحبا شباب

عندي مود سعد التيممات

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

بس لا شعلته ما يحفظ حتى اول ما اخش يكون فيه باقي الدرع ولا سجلت الدخول يرجع كل شي كاني توي مسجل

اطرح الاكواد ولا م يحتاج لين الاكواد كثير او حددو اي ملف تبون اطرجه

شوفو لي حل ي حلالين كل مشاكلي ^_^

Link to comment

المشكله مو بالكود الكود يحفظ و كل شي بس لا ركبت مود سعد حق التيمات

ما يحفظ مود سعد يخرب عليه

انا ابيه يحفظ و مود سعد موجود

يحفظ درع- سلاح-نجوم

بس مود سعد يجبره ما بحفظ شي

Link to comment
المشكله مو بالكود الكود يحفظ و كل شي بس لا ركبت مود سعد حق التيمات

ما يحفظ مود سعد يخرب عليه

انا ابيه يحفظ و مود سعد موجود

يحفظ درع- سلاح-نجوم

بس مود سعد يجبره ما بحفظ شي

# أجل المشكلةة من المود حق سعد , دام الكود شغال , ووقت يشتغل المود حق سعد يخربه , ِ ششيكـ على مود سعد

Link to comment

كلنت

local x, y = guiGetScreenSize() 
rRoot = getResourceRootElement(getThisResource())
Music = "Other/Intro.mp3"
Anims = {"DAN_UP_A", "dnce_M_b", "DAN_Left_A", "DAN_Down_A", "DAN_Loop_A", "dance_loop"}
num = 0
local TeamNameee = ""
local Team = ""
local findskin = nil
local Text = ""
local mn = nil
Color = {255, 255, 255}
local NewTeam = 0
local ID, skin = nil, nil, nil
TeamName = {"Grove", "Aztecas", "Police", "Ballas", "No Team", "Medic"}
local WaeponID = {5, 22, 3, 1, 32, 41, 43}
allPlayer = 0
local Weapon = 0
local NameWeap = "Fist"
GameType = {}
ColorGame = {0, 255, 255}
GameNameType = ""
Info = {}
SkinSelectMusic = nil
local foundTeam = 0
local findskin = 0
typeGame = "gang"
local foundInTeam = ""
local foundInall = ""
Ped = {}  
skin = {
Grove = {105, 106, 107},
Aztecas = {115, 116, 117},
Police = {283, 284, 285},
Ballas = {102, 103, 104},
["No Team"] = {28, 34, 123, 230, 7, 15, 16, 21, 19, 22, 23, 24, 26, 28, 29, 30, 32, 33, 34, 37, 45, 46, 59, 72, 137, 189, 200, 217, 212, 240, 241, 247, 248, 261},
Medic = {274, 275, 276},
}
 
AllTeamName = {
Grove = {2494.96948, -1684.03101, 14.3313, 2494.98486, -1685.02856, 14.26363, 2495.38843, -1688.54297, 13.87171},
Aztecas = {1764.75586, -1928.03674, 15.2383, 1763.80432, -1928.0498, 14.93086, 1761.0708, -1928.08801, 13.57734},
Police = {1568.73779, -1695.54541, 7.0456, 1568.71582, -1694.55835, 6.8869, 1568.64075, -1691.68494, 5.89063},
Ballas = {2217.03027, -1167.91956, 27.0701, 2217.0166, -1168.89661, 26.85767, 2216.97534, -1171.77625, 25.72656},
["No Team"] = {901.33551, -1208.65796, 18.4756, 901.27332, -1207.69299, 18.22063, 901.05676, -1204.8208, 16.98322},
Medic = {2022.72839, -1426.36877, 18.3914, 2023.34521, -1425.61548, 18.16297, 2025.20178, -1423.47644, 16.99219},
}
Rot = {357.4391784668, 271.10339355469, 179.70733642578, 0, 179.01052856445, 132.08488464355}
 
CamGameType = {
{2454.49487, -1654.69812, 26.19402, 2541.42432, -1686.7251, -11.45641}
}
 
function dxDrawColorText(str, ax, ay, bx, by, color, scale, font, alignX, alignY)
  bx, by, color, scale, font = bx or ax, by or ay, color or tocolor(255,255,255,255), scale or 1, font or "default"
  if alignX then
    if alignX == "center" then
      ax = ax + (bx - ax - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font))/2
    elseif alignX == "right" then
      ax = bx - dxGetTextWidth(str:gsub("#%x%x%x%x%x%x",""), scale, font)
    end
  end
  if alignY then
    if alignY == "center" then
      ay = ay + (by - ay - dxGetFontHeight(scale, font))/2
    elseif alignY == "bottom" then
      ay = by - dxGetFontHeight(scale, font)
    end
  end
  local alpha = string.format("%08X", color):sub(1,2)
  local pat = "(.-)#(%x%x%x%x%x%x)"
  local s, e, cap, col = str:find(pat, 1)
  local last = 1
  while s do
    if cap == "" and col then color = tocolor(getColorFromString("#"..col..alpha)) end
    if s ~= 1 or cap ~= "" then
      local w = dxGetTextWidth(cap, scale, font)
      dxDrawText(cap, ax, ay, ax + w, by, color, scale, font,"left", "top", false, false, true, false, false)
      ax = ax + w
      color = tocolor(getColorFromString("#"..col..alpha))
    end
    last = e + 1
    s, e, cap, col = str:find(pat, last)
  end
  if last <= #str then
    cap = str:sub(last)
    dxDrawText(cap, ax, ay, ax + dxGetTextWidth(cap, scale, font), by, color, scale, font,"left", "top", false, false, true, false, false)
  end
end
 
local function getTeam(team)
    return getTeamFromName(team)
end
 
local function count(team)
    return countPlayersInTeam(getTeamFromName(team))
end
 
function onStop()
    resetSkyGradient()
    showChat(true)
    showPlayerHudComponent("all", true)
end
addEventHandler("onClientResourceStop", resourceRoot, onStop)
 
function foundPos(nummm)
    local foundPo = AllTeamName[TeamName[NewTeam]][tonumber(nummm)]
    return foundPo
end
 
function showforallteam()
    fadeCamera( true )
    showChat(false)
    SpawnGameType()
    --[[
    foundInTeam = "There are Players"  
    foundInall = "all Players"
    GameType = {"Gang Wars"}
    Info = {"Wlecom To Gang Wars","To Spawn press [Enter]"}
    GameNameType = "Gang Wars"
    mn = nil
    bindKey("enter","down",SpawnGameType)
    l1, l2, l3, l4, l5, l6 = unpack(CamGameType[1])
    info1 = Info[1]
    info2 = Info[2]
    ShowGameType()
    addEventHandler("onClientRender",getRootElement(),DrawGameType)
    --]]
end
 
addEventHandler("onClientPlayerWasted", getLocalPlayer(), function(killer, weapon, bodypart)
    if getElementData(localPlayer, "WasChangeTeam") == true then
      showforallteam()
    else
      return false
    end
end)
 
function ShowGameType()
    ColorGame = {255,255,0}
    l1, l2, l3, l4, l5, l6 = unpack(CamGameType[1])
    setCameraMatrix(l1, l2, l3, l4, l5, l6)
    SelectGame = 1
    GameNameType = GameType[1]
    count2 =  count("Grove")
    count3 =  count("Aztecas")
    count4 =  count("Police")
    count5 =  count("Ballas")
    count6 =  count("No Team")
    mn = count2 + count3 + count4 + count5 + count6
    typeGame = "gang"      
end
 
 
function SpawnGameType()
    setTimer(MakeGangWars, 500, 1)
    TeamNameee = "Team Name"
end
 
function MakeGangWars()
    Color = {0, 255, 0}
    Team = " " .. TeamName[1] .. " "
    allPlayer = count(TeamName[1])
    Weapon = WaeponID[1]
    NameWeap = getWeaponNameFromID(Weapon)
    NameWeap = getWeaponNameFromID(Weapon)
    NewTeam = 1
    local x, y, z, lx, ly, lz = foundPos(1), foundPos(2), foundPos(3), foundPos(4), foundPos(5), foundPos(6)
    setCameraMatrix(x, y, z, lx, ly, lz)
    ---removeEventHandler("onClientRender", getRootElement(), DrawGameType)
    bindKey("arrow_r", "down", Next)
    bindKey("arrow_l", "down", Next)
    bindKey("enter", "down", SpawnPlayer)
    addEventHandler("onClientRender", getRootElement(), DrawTeam)
    SkinSelectMusic = playSound(Music, true)
    local pedx, pedy, pedz = foundPos(7), foundPos(8), foundPos(9)
    findskin = math.random(1, 3)
    ID = 105
    Ped[1] = createPed(ID, pedx, pedy, pedz, Rot[1])
    if not isElement(Ped[1]) then
      Ped[1] = createPed(ID, pedx, pedy, pedz, Rot[NewTeam])
    end
    setElementFrozen(Ped[1], true)
    setPedAnimation(Ped[1], "DANCING", Anims[math.random(1, 6)])
    foundTeam = 1
    findskin = 1
end
 
function Next(key)
    if key == "arrow_l" then
      num = num - 1
    else
      num = num + 1
    end
    if key == "arrow_l" then
      findskin = findskin - 1
    else
      findskin = findskin + 1
    end
    if findskin < 1 then
      findskin = 3
    end
    if TeamName[number] and TeamName[number] == "No Team" then
        if findskin > #skin["No Team"] then
            findskin = 1
        end
    else
        if findskin > 3 then
            findskin = 1
        end
    end
    if num < 1 then
      num = 12+#skin["No Team"]+#skin['Medic']
      foundTeam = 6
    end
    if num == 1 or num == 3 then
      foundTeam = 1
    end  
    if num == 4 or num == 6 then
      foundTeam = 2
    end  
    if num == 7 or num == 9 then
      foundTeam = 3
    end  
    if num == 10 or num == 12 then
      foundTeam = 4
    end  
    if num == 13 or num == 12+#skin["No Team"] then
      foundTeam = 5
    end
    if num == 12+#skin["No Team"]+1 or num == 12+#skin["No Team"] + #skin['Medic'] then
      foundTeam = 6
    end  
    if num > 12+#skin["No Team"] + #skin['Medic'] then
      foundTeam = 1
      num = 1
    end
    number = foundTeam
    ID = skin[TeamName[number]][findskin]
    Team = " " .. TeamName[number] .. " "
    NewTeam = foundTeam
    TextColor(number)
    setElementModel(Ped[1], ID)
    setPedAnimation(Ped[1], "DANCING", Anims[math.random(1, 5)])
    if Ped[1] then
      destroyElement(Ped[1])
      Ped[1] = nil
    end
    local x, y, z, lx, ly, lz = foundPos(1), foundPos(2), foundPos(3), foundPos(4), foundPos(5), foundPos(6)
    wasFoundCamAndPed = foundTeam
    local pedx, pedy, pedz = foundPos(7), foundPos(8), foundPos(9)
    Ped[1] =
Link to comment

هنا عدل

وضيف عليه عند تسجيل الدخول

addEventHandler("onPlayerQuit", root, function() 
  setPlayerTeam(source, nil) 
  local playeraccount = getPlayerAccount(source) 
  if playeraccount and not isGuestAccount(playeraccount) then 
    setAccountData(playeraccount, "s.weap0", getPedWeapon(source, 0)) 
    setAccountData(playeraccount, "s.weap1", getPedWeapon(source, 1)) 
    setAccountData(playeraccount, "s.weap2", getPedWeapon(source, 2)) 
    setAccountData(playeraccount, "s.ammo2", getPedTotalAmmo(source, 2)) 
    setAccountData(playeraccount, "s.weap3", getPedWeapon(source, 3)) 
    setAccountData(playeraccount, "s.ammo3", getPedTotalAmmo(source, 3)) 
    setAccountData(playeraccount, "s.weap4", getPedWeapon(source, 4)) 
    setAccountData(playeraccount, "s.ammo4", getPedTotalAmmo(source, 4)) 
    setAccountData(playeraccount, "s.weap5", getPedWeapon(source, 5)) 
    setAccountData(playeraccount, "s.ammo5", getPedTotalAmmo(source, 5)) 
    setAccountData(playeraccount, "s.weap6", getPedWeapon(source, 6)) 
    setAccountData(playeraccount, "s.ammo6", getPedTotalAmmo(source, 6)) 
    setAccountData(playeraccount, "s.weap7", getPedWeapon(source, 7)) 
    setAccountData(playeraccount, "s.ammo7", getPedTotalAmmo(source, 7)) 
    setAccountData(playeraccount, "s.weap8", getPedWeapon(source, 7+1)) 
    setAccountData(playeraccount, "s.ammo8", getPedTotalAmmo(source, 7+1)) 
    setAccountData(playeraccount, "s.weap9", getPedWeapon(source, 9)) 
    setAccountData(playeraccount, "s.ammo9", getPedTotalAmmo(source, 9)) 
    setAccountData(playeraccount, "s.weap10", getPedWeapon(source, 10)) 
    setAccountData(playeraccount, "s.weap11", getPedWeapon(source, 11)) 
    setAccountData(playeraccount, "s.weap12", getPedWeapon(source, 12)) 
    setAccountData(playeraccount, "WantedLevel", getPlayerWantedLevel(source)) 
  end 
end) 

Link to comment

يالغلا على ما أضن أنه يحفظ بس اضن لاسويت ريست للمود مايرجعلك السلاح اللي معك لانه محطوط يعطيك مره وحده

إذا ماتمت الأفاده بلغني وأحاول اعدله لك

تحياتي

Link to comment

هنا عدل

وضيف عليه عند تسجيل الدخول

addEventHandler("onPlayerQuit", root, function()
  setPlayerTeam(source, nil)
  local playeraccount = getPlayerAccount(source)
  if playeraccount and not isGuestAccount(playeraccount) then
    setAccountData(playeraccount, "s.weap0", getPedWeapon(source, 0))
    setAccountData(playeraccount, "s.weap1", getPedWeapon(source, 1))
    setAccountData(playeraccount, "s.weap2", getPedWeapon(source, 2))
    setAccountData(playeraccount, "s.ammo2", getPedTotalAmmo(source, 2))
    setAccountData(playeraccount, "s.weap3", getPedWeapon(source, 3))
    setAccountData(playeraccount, "s.ammo3", getPedTotalAmmo(source, 3))
    setAccountData(playeraccount, "s.weap4", getPedWeapon(source, 4))
    setAccountData(playeraccount, "s.ammo4", getPedTotalAmmo(source, 4))
    setAccountData(playeraccount, "s.weap5", getPedWeapon(source, 5))
    setAccountData(playeraccount, "s.ammo5", getPedTotalAmmo(source, 5))
    setAccountData(playeraccount, "s.weap6", getPedWeapon(source, 6))
    setAccountData(playeraccount, "s.ammo6", getPedTotalAmmo(source, 6))
    setAccountData(playeraccount, "s.weap7", getPedWeapon(source, 7))
    setAccountData(playeraccount, "s.ammo7", getPedTotalAmmo(source, 7))
    setAccountData(playeraccount, "s.weap8", getPedWeapon(source, 7+1))
    setAccountData(playeraccount, "s.ammo8", getPedTotalAmmo(source, 7+1))
    setAccountData(playeraccount, "s.weap9", getPedWeapon(source, 9))
    setAccountData(playeraccount, "s.ammo9", getPedTotalAmmo(source, 9))
    setAccountData(playeraccount, "s.weap10", getPedWeapon(source, 10))
    setAccountData(playeraccount, "s.weap11", getPedWeapon(source, 11))
    setAccountData(playeraccount, "s.weap12", getPedWeapon(source, 12))
    setAccountData(playeraccount, "WantedLevel", getPlayerWantedLevel(source))
  end
end)

م ضبط ي بعدي

Link to comment
يالغلا على ما أضن أنه يحفظ بس اضن لاسويت ريست للمود مايرجعلك السلاح اللي معك لانه محطوط يعطيك مره وحده

إذا ماتمت الأفاده بلغني وأحاول اعدله لك

تحياتي

م ضبط ي ليت تشوف لنا حل للمعلوميه انا شايل السلاح للاي اول م يسجل لين لو طلع و دخل الاسلحه ترجع له من جديد

Link to comment
  • 2 weeks later...

مو مجرب ,

Server Side ~

ver = "" 
rRoot = getResourceRootElement(getThisResource())
local root = getRootElement()
local Key = "F4"
Teams = {  -- here all team name
{"Grove", 16, 198, 29},
{"Aztecas", 0, 150, 255},
{"Police", 0, 50, 255},
{"Ballas", 156, 6, 141},
{"No Team", 255, 255, 255},
{"Medic", 6, 183, 248}
}
 
local function set(plr, data, bole)
  if not isElement(plr) then
    return
  end
  return setElementData(plr, data, bole)
end
 
local function get(plr, data)
  if not isElement(plr) then
    return
  end
  return getElementData(plr, data)
end
 
addEventHandler("onResourceStart", resourceRoot, function()
  setGameType("")
  outputChatBox("" .. ver .. "", root, 0, 255, 0, true)
  setTimer(OutPut, 50, 1, "" .. ver .. "", root, 0, 255, 0)
  for _,theTeam in ipairs(Teams) do
    createTeam(theTeam[1], theTeam[2], theTeam[3], theTeam[4])
  end
  for _,AllTeams in ipairs(getElementsByType("team")) do
    if getTeamFriendlyFire(AllTeams) == true then
      setTeamFriendlyFire(AllTeams, false)
    end
  end
  setTeamFriendlyFire(getTeamFromName("No Team"), true)
  for i,v in ipairs(getElementsByType("player")) do
    bindKey(v, Key, "down", "changeTeame")
    setElementData(v, "OnJoinFirstSpawn", false)
  end
  setElementData(rRoot,"maxPlayer",getMaxPlayers())
end
)
 
addEventHandler("onResourceStop", resourceRoot, function()
  local players = getElementsByType("player")
  for k,v in ipairs(players) do
    set(v, "hjwalah", false)
    set(v, "Grove", false)
    set(v, "Aztecs", false)
    set(v, "Police", false)
    set(v, "Ballas", false)
    set(v, "noTeam", false)
    set(v, "Medic", false)
    set(v, "GameModeActive", false)
  end
end
)
 
addEvent("onLoadedClient", true)
addEventHandler("onLoadedClient", root, function(player)
  versionDisplay = textCreateDisplay()
  local versionText = textCreateTextItem(" " .. ver .. "", 0.975, 0.02, "medium", 255, 0, 0, 255, 1.1, "right")
  textDisplayAddText(versionDisplay, versionText)
  textDisplayAddObserver(versionDisplay, player)
  setElementData(player, "CancleFirstSpawn", true)
  playSoundFrontEnd(player, 16)
  OutPut("The download was successful|", player, 255, 255, 0)
  setElementData(player, "OnJoinFirstSpawn", false)
end
)
 
addEventHandler("onPlayerJoin", root, function()
    showTextForPlayer ( source, 6000, 255, 0, 0, 1.5, "Wlecom To Server Gangs War")
    showTextForPlayer1 ( source, 6000, 255, 0, 0, 1.5, "....!")            
    setCameraMatrix(source,512.2, -1263.57, 32.53,542.16, -1287.07, 17.24)  
end
)
 
addEventHandler("onPlayerSpawn", root, function()
  checkWeapon(source)
end
)
       
function checkWeapon(player)
  setTimer(function(player)
    if isElement(player) then
      if getElementData(player, "Police") == true then
        giveWeapon(player, 3)
      end
    else
      takeWeapon(player, 3)
    end
  end, 800, 1, player)
end
 
addEvent("onClientWantsToSpawn", true)
addEventHandler("onClientWantsToSpawn", getRootElement(), function(player, ID, TeamName)
  if TeamName == "Grove" then
    setElementData(player, "ID", ID)
    GroveTeam(player)
  elseif TeamName == "Aztecas" then
    setElementData(player, "ID", ID)
    AztecsTeam(player)
  elseif TeamName == "Police" then
    setElementData(player, "ID", ID)
    PoliceTeam(player)
  elseif TeamName == "Ballas" then
    setElementData(player, "ID", ID)
    Ballas(player)
  elseif TeamName == "No Team" then
    setElementData(player, "ID", ID)
    NoTeam(player)
  elseif TeamName == "Medic" then
    setElementData(player, "ID", ID)
    MedicTeam(player)
  elseif TeamName == "Drift" then
    setElementData(player, "ID", ID)
    hjwalah(player)
  end
end
)
 
function checkWeapon(player)
  setTimer(function(player)
    if isElement(player) then
      if getElementData(player, "Police") == true then
        giveWeapon(player, 3)
      end
    else
      takeWeapon(player, 3)
    end
  end, 800, 2, player)
end
 
function onSelectTeam(player)
  if not isElement(player) then
    return
  end
  local playerTeam = getPlayerTeam(player)
  showTextForPlayer(player, 5000, 255, 0, 0, 1.5, " [" .. tostring(getTeamName(playerTeam)) .. "]")
  OutPut("To return to spawn press["..Key.."]", player, 255, 255, 255)
    if getElementData(player, "hjwalah") == true then
      return false
    end
    if getElementData(player, "wasgied") == true then
      return false
    end
    setElementData(player, "wasgied", true)
end
 
function camera(plr)
  if not isElement(plr) then
    return
  end
  setTimer(fadeCamera, 50, 1, plr, false, 1)
  setTimer(fadeCamera, 100, 1, plr, true, 3)
  setCameraTarget(plr, plr)
  showChat(plr, true)
end
 
addEventHandler("onPlayerSpawn", root, function()
  setElementData(source, "FristTimeSpawn", false)
  bindKey(source, Key, "down", "changeTeame")
  setElementData(source, "WasChangeTeam", false)
end
)
 
Change = false
 
addCommandHandler("changeTeame", function(plr)
  if getElementData(plr, "WasChangeTeam") == false then
    setElementData(plr, "ChangeTeam", true)
    OutPut("تغيير الفريق بعد الموت", plr, 255, 0, 255)
    setTimer(cancleTeam, 1700, 1, plr)
    setElementData(plr, "WasChangeTeam", true)
  else
    OutPut(" تم إلغاء تغيير فريق ", plr, 255, 255, 0)
    setElementData(plr, "ChangeTeam", false)
    setElementData(plr, "WasChangeTeam", false)
  end
  Change = not Change
end
)
 
function cancleTeam(plr)
  if Change == false then
    return false
  end
  OutPut("", plr, 255, 255, 0)
end
 
function GroveTeam(plr)
  if not isElement(plr) then
    return
  end
  camera(plr)
  local data = tonumber(getElementData(plr, "ID")) or 107
  spawnPlayer(plr, 2495.3327636719,-1688.6165771484,13.917698860168, 0, data, 0, 0, getTeamFromName("Grove"))
  r, g, b = getTeamColor(getPlayerTeam(plr))
  setPlayerNametagColor(plr, r, g, b)
  onSelectTeam(plr)
  set(plr, "Grove", true)
  set(plr, "Aztecs", false)
  set(plr, "Police", false)
  set(plr, "Ballas", false)
  set(plr, "noTeam", false)
  set(plr, "hjwalah", false)
  set(plr, "Medic", false)
  set(plr, "GameModeActive", true)
end
 
function AztecsTeam(plr)
  if not isElement(plr) then
    return
  end
  camera(plr)
  local data = tonumber(getElementData(plr, "ID")) or 115
  spawnPlayer(plr, 1756.07324, -1928.89209, 13.57651, 0, data, 0, 0, getTeamFromName("Aztecas"))
  r, g, b = getTeamColor(getPlayerTeam(plr))
  setPlayerNametagColor(plr, r, g, b)
  onSelectTeam(plr)
  set(plr, "Aztecs", true)
  set(plr, "Grove", false)
  set(plr, "Police", false)
  set(plr, "Ballas", false)
  set(plr, "noTeam", false)
  set(plr, "hjwalah", false)
  set(plr, "Medic", false)
  set(plr, "GameModeActive", true)
end
 
function PoliceTeam(plr)
  if not isElement(plr) then
    return
  end
  camera(plr)
  local data = tonumber(getElementData(plr, "ID")) or 285
  spawnPlayer(plr, 1586.31616, -1690.74158, 6.21875, 0, data, 0, 0, getTeamFromName("Police"))
  r, g, b = getTeamColor(getPlayerTeam(plr))
  setPlayerNametagColor(plr, r, g, b)
  giveWeapon(plr, 3)
  onSelectTeam(plr)
  set(plr, "Police", true)
  set(plr, "Grove", false)
  set(plr, "Aztecs", false)
 
Link to comment
مو مجرب ,

Server Side ~

ver = "" 
rRoot = getResourceRootElement(getThisResource())
local root = getRootElement()
local Key = "F4"
Teams = {  -- here all team name
{"Grove", 16, 198, 29},
{"Aztecas", 0, 150, 255},
{"Police", 0, 50, 255},
{"Ballas", 156, 6, 141},
{"No Team", 255, 255, 255},
{"Medic", 6, 183, 248}
}
 
local function set(plr, data, bole)
  if not isElement(plr) then
    return
  end
  return setElementData(plr, data, bole)
end
 
local function get(plr, data)
  if not isElement(plr) then
    return
  end
  return getElementData(plr, data)
end
 
addEventHandler("onResourceStart", resourceRoot, function()
  setGameType("")
  outputChatBox("" .. ver .. "", root, 0, 255, 0, true)
  setTimer(OutPut, 50, 1, "" .. ver .. "", root, 0, 255, 0)
  for _,theTeam in ipairs(Teams) do
    createTeam(theTeam[1], theTeam[2], theTeam[3], theTeam[4])
  end
  for _,AllTeams in ipairs(getElementsByType("team")) do
    if getTeamFriendlyFire(AllTeams) == true then
      setTeamFriendlyFire(AllTeams, false)
    end
  end
  setTeamFriendlyFire(getTeamFromName("No Team"), true)
  for i,v in ipairs(getElementsByType("player")) do
    bindKey(v, Key, "down", "changeTeame")
    setElementData(v, "OnJoinFirstSpawn", false)
  end
  setElementData(rRoot,"maxPlayer",getMaxPlayers())
end
)
 
addEventHandler("onResourceStop", resourceRoot, function()
  local players = getElementsByType("player")
  for k,v in ipairs(players) do
    set(v, "hjwalah", false)
    set(v, "Grove", false)
    set(v, "Aztecs", false)
    set(v, "Police", false)
    set(v, "Ballas", false)
    set(v, "noTeam", false)
    set(v, "Medic", false)
    set(v, "GameModeActive", false)
  end
end
)
 
addEvent("onLoadedClient", true)
addEventHandler("onLoadedClient", root, function(player)
  versionDisplay = textCreateDisplay()
  local versionText = textCreateTextItem(" " .. ver .. "", 0.975, 0.02, "medium", 255, 0, 0, 255, 1.1, "right")
  textDisplayAddText(versionDisplay, versionText)
  textDisplayAddObserver(versionDisplay, player)
  setElementData(player, "CancleFirstSpawn", true)
  playSoundFrontEnd(player, 16)
  OutPut("The download was successful|", player, 255, 255, 0)
  setElementData(player, "OnJoinFirstSpawn", false)
end
)
 
addEventHandler("onPlayerJoin", root, function()
    showTextForPlayer ( source, 6000, 255, 0, 0, 1.5, "Wlecom To Server Gangs War")
    showTextForPlayer1 ( source, 6000, 255, 0, 0, 1.5, "....!")            
    setCameraMatrix(source,512.2, -1263.57, 32.53,542.16, -1287.07, 17.24)  
end
)
 
addEventHandler("onPlayerSpawn", root, function()
  checkWeapon(source)
end
)
       
function checkWeapon(player)
  setTimer(function(player)
    if isElement(player) then
      if getElementData(player, "Police") == true then
        giveWeapon(player, 3)
      end
    else
      takeWeapon(player, 3)
    end
  end, 800, 1, player)
end
 
addEvent("onClientWantsToSpawn", true)
addEventHandler("onClientWantsToSpawn", getRootElement(), function(player, ID, TeamName)
  if TeamName == "Grove" then
    setElementData(player, "ID", ID)
    GroveTeam(player)
  elseif TeamName == "Aztecas" then
    setElementData(player, "ID", ID)
    AztecsTeam(player)
  elseif TeamName == "Police" then
    setElementData(player, "ID", ID)
    PoliceTeam(player)
  elseif TeamName == "Ballas" then
    setElementData(player, "ID", ID)
    Ballas(player)
  elseif TeamName == "No Team" then
    setElementData(player, "ID", ID)
    NoTeam(player)
  elseif TeamName == "Medic" then
    setElementData(player, "ID", ID)
    MedicTeam(player)
  elseif TeamName == "Drift" then
    setElementData(player, "ID", ID)
    hjwalah(player)
  end
end
)
 
function checkWeapon(player)
  setTimer(function(player)
    if isElement(player) then
      if getElementData(player, "Police") == true then
        giveWeapon(player, 3)
      end
    else
      takeWeapon(player, 3)
    end
  end, 800, 2, player)
end
 
function onSelectTeam(player)
  if not isElement(player) then
    return
  end
  local playerTeam = getPlayerTeam(player)
  showTextForPlayer(player, 5000, 255, 0, 0, 1.5, " [" .. tostring(getTeamName(playerTeam)) .. "]")
  OutPut("To return to spawn press["..Key.."]", player, 255, 255, 255)
    if getElementData(player, "hjwalah") == true then
      return false
    end
    if getElementData(player, "wasgied") == true then
      return false
    end
    setElementData(player, "wasgied", true)
end
 
function camera(plr)
  if not isElement(plr) then
    return
  end
  setTimer(fadeCamera, 50, 1, plr, false, 1)
  setTimer(fadeCamera, 100, 1, plr, true, 3)
  setCameraTarget(plr, plr)
  showChat(plr, true)
end
 
addEventHandler("onPlayerSpawn", root, function()
  setElementData(source, "FristTimeSpawn", false)
  bindKey(source, Key, "down", "changeTeame")
  setElementData(source, "WasChangeTeam", false)
end
)
 
Change = false
 
addCommandHandler("changeTeame", function(plr)
  if getElementData(plr, "WasChangeTeam") == false then
    setElementData(plr, "ChangeTeam", true)
    OutPut("تغيير الفريق بعد الموت", plr, 255, 0, 255)
    setTimer(cancleTeam, 1700, 1, plr)
    setElementData(plr, "WasChangeTeam", true)
  else
    OutPut(" تم إلغاء تغيير فريق ", plr, 255, 255, 0)
    setElementData(plr, "ChangeTeam", false)
    setElementData(plr, "WasChangeTeam", false)
  end
  Change = not Change
end
)
 
function cancleTeam(plr)
  if Change == false then
    return false
  end
  OutPut("", plr, 255, 255, 0)
end
 
function GroveTeam(plr)
  if not isElement(plr) then
    return
  end
  camera(plr)
  local data = tonumber(getElementData(plr, "ID")) or 107
  spawnPlayer(plr, 2495.3327636719,-1688.6165771484,13.917698860168, 0, data, 0, 0, getTeamFromName("Grove"))
  r, g, b = getTeamColor(getPlayerTeam(plr))
  setPlayerNametagColor(plr, r, g, b)
  onSelectTeam(plr)
  set(plr, "Grove", true)
  set(plr, "Aztecs", false)
  set(plr, "Police", false)
  set(plr, "Ballas", false)
  set(plr, "noTeam", false)
  set(plr, "hjwalah", false)
  set(plr, "Medic", false)
  set(plr, "GameModeActive", true)
end
 
function AztecsTeam(plr)
  if not isElement(plr) then
    return
  end
  camera(plr)
  local data = tonumber(getElementData(plr, "ID")) or 115
  spawnPlayer(plr, 1756.07324, -1928.89209, 13.57651, 0, data, 0, 0, getTeamFromName("Aztecas"))
  r, g, b = getTeamColor(getPlayerTeam(plr))
  setPlayerNametagColor(plr, r, g, b)
  onSelectTeam(plr)
  set(plr, "Aztecs", true)
  set(plr, "Grove", false)
  set(plr, "Police", false)
  set(plr, "Ballas", false)
  set(plr, "noTeam", false)
  set(plr, "hjwalah", false)
  set(plr, "Medic", false)
  set(plr, "GameModeActive", true)
end
 
function PoliceTeam(plr)
  if not isElement(plr) then
    return
  end
  camera(plr)
  local data = tonumber(getElementData(plr, "ID")) or 285
  spawnPlayer(plr, 1586.31616, -1690.74158, 6.21875, 0, data, 0, 0, getTeamFromName("Police"))
  r, g, b = getTeamColor(getPlayerTeam(plr))
  setPlayerNametagColor(plr, r, g, b)
  giveWeapon(plr, 3)
  onSelectTeam(plr)
  set(plr, "Police", true)
 
Link to comment
وش المشكله حاليا؟ جربت الكود؟

المشكله في كودك لا طلعت الشخصيات و اخترت شخصيه م يبدا العبه يعلق ع الشخصيات نفسها

،،

ومشكله المود نفسه م يحفظ سلاح

Link to comment
ايه اضن مود الحفظ ما يشتغل إلا على

play

انا مجرب قبل كذا

لكن قيم مود ثاني ما يحفظ

:o:o:o:o

مو مصدق جرب

يقول المثل

لا يصدق الـ**** حتى يرى

وش الي جرب ,, وش دخل البلاي في الحفظ ؟؟؟؟ فهمني

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