Jump to content

تصليح


Recommended Posts

اخي كودك شغال انة نا يقدر يدخل تيم الشرطة يلي عية نجوم

بس

اكتر من سكن

بعطيك مثال

انا حطيط في الشرطة 9 شخصيات

لما اعص على زر السهم اليمين

بجو تقريبا 6

بس لما ارجع

على الزر السهم الشمال

بجو كلهم

انا بدي لما اروح و لما ارجع

مثال احسن

Aztecas = {115, 116, 117 ,0 ,173 , 174 ,175 ,176 ,177}, 

لما اعص على زر السهم اليمين

0 يبلش من سكن

لما لما ارجع بسير يجو كلهم

+

ابي اسالك

هدول انة الكاميرا و انة البيد

Grove = {2494.96948, -1684.03101, 14.3313, 2494.98486, -1685.02856, 14.26363, 2495.38843, -1688.54297, 13.87171}, 

Link to comment
اخي كودك شغال انة نا يقدر يدخل تيم الشرطة يلي عية نجوم

بس

اكتر من سكن

بعطيك مثال

انا حطيط في الشرطة 9 شخصيات

لما اعص على زر السهم اليمين

بجو تقريبا 6

بس لما ارجع

على الزر السهم الشمال

بجو كلهم

انا بدي لما اروح و لما ارجع

مثال احسن

Aztecas = {115, 116, 117 ,0 ,173 , 174 ,175 ,176 ,177}, 

لما اعص على زر السهم اليمين

0 يبلش من سكن

لما لما ارجع بسير يجو كلهم

+

ابي اسالك

هدول انة الكاميرا و انة البيد

Grove = {2494.96948, -1684.03101, 14.3313, 2494.98486, -1685.02856, 14.26363, 2495.38843, -1688.54297, 13.87171}, 

  
 
 
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 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 ,0 ,173 , 174 ,175 ,176 ,177},
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)
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
        findskin = findskin - 1    
        if findskin < 1 then
            foundTeam = foundTeam - 1
            if foundTeam < 1 then
                foundTeam = #TeamName
            end
            findskin = #skin[TeamName[foundTeam]]          
        end 
    else
        findskin = findskin + 1
        if findskin > #skin[TeamName[foundTeam]] then
            if findskin > #skin[TeamName[foundTeam]] then
                findskin = 1
            end    
            foundTeam = foundTeam + 1
            if foundTeam > #TeamName then
                foundTeam = 1
            end
        end
    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] = createPed(ID, pedx, pedy, pedz, Rot[number])
    if not isElement(Ped[1]) then
        Ped[1] = createPed(ID, pedx, pedy, pedz, Rot[number])
    end
    setElementFrozen(Ped[1], true)
    setPedAnimation(Ped[1], "DANCING", Anims[math.random(1, 6)])
    setCameraMatrix(x, y, z, lx, ly, lz)
end
 
function TextColor(numbe)
    if TeamName[numbe] == "Grove" then
        Color = {0, 255, 0}
    elseif TeamName[numbe] == "Aztecas" then
        Color = {0, 150, 255}
    elseif TeamName[numbe] == "Police" then
        Color = {0, 50, 255}
    elseif TeamName[numbe] == "Ballas" then
        Color = {255, 0, 150}
    elseif TeamName[numbe] == "No Team" then
        Color = {255, 255, 255}
    elseif TeamName[numbe] == "Medic" then
        Color = {6, 183, 248}
    end
    allPlayer = count(TeamName[numbe]) or 0
    Weapon = WaeponID[numbe] or 0
    NameWeap = getWeaponNameFromID(Weapon) or 0
end
 
Link to comment

اخي يا ريت تساعدني في هاي كمان

انة ما يحفظ الاسلحة لما يطلع

function onSelectTeam(player) 
  if not isElement(player) then 
    return  
  end 
  local playerTeam = getPlayerTeam(player) 
  showTextForPlayer(player, 5000, 255, 0, 0, 1.5, "You have been assigned to team [" .. tostring(getTeamName(playerTeam)) .. "]") 
  OutPut("To return to spawn press["..Key.."]", player, 255, 255, 255) 
  local playeraccount = getPlayerAccount(player) 
  if playeraccount and not isGuestAccount(getPlayerAccount(player)) then 
    if getElementData(player, "hjwalah") == true then 
      return false 
    end 
    if getElementData(player, "wasgied") == true then 
      return false 
    end 
    setElementData(player, "wasgied", true) 
    local weap0 = getAccountData(playeraccount, "s.weap0") 
    local weap1 = getAccountData(playeraccount, "s.weap1") 
    local weap2 = getAccountData(playeraccount, "s.weap2") 
    local ammo2 = getAccountData(playeraccount, "s.ammo2") 
    local weap3 = getAccountData(playeraccount, "s.weap3") 
    local ammo3 = getAccountData(playeraccount, "s.ammo3") 
    local weap4 = getAccountData(playeraccount, "s.weap4") 
    local ammo4 = getAccountData(playeraccount, "s.ammo4") 
    local weap5 = getAccountData(playeraccount, "s.weap5") 
    local ammo5 = getAccountData(playeraccount, "s.ammo5") 
    local weap6 = getAccountData(playeraccount, "s.weap6") 
    local ammo6 = getAccountData(playeraccount, "s.ammo6") 
    local weap7 = getAccountData(playeraccount, "s.weap7") 
    local ammo7 = getAccountData(playeraccount, "s.ammo7") 
    local weap8 = getAccountData(playeraccount, "s.weap8") 
    local ammo8 = getAccountData(playeraccount, "s.ammo8") 
    local weap9 = getAccountData(playeraccount, "s.weap9") 
    local ammo9 = getAccountData(playeraccount, "s.ammo9") 
    local weap10 = getAccountData(playeraccount, "s.weap10") 
    local weap11 = getAccountData(playeraccount, "s.weap11") 
    local weap12 = getAccountData(playeraccount, "s.weap12") 
    local wanted = getAccountData(playeraccount, "WantedLevel") 
    if tonumber(wanted) then 
      setPlayerWantedLevel(player, wanted) 
   elseif tonumber(weap0) then 
      giveWeapon(player, weap0, 1) 
  elseif tonumber(weap1) then 
      giveWeapon(player, weap1, 1) 
  elseif tonumber(weap2) and tonumber(ammo2) then 
      giveWeapon(player, weap2, ammo2) 
  elseif tonumber(weap3) and tonumber(ammo3) then 
      giveWeapon(player, weap3, ammo3) 
  elseif tonumber(weap4) and tonumber(ammo4) then 
      giveWeapon(player, weap4, ammo4) 
  elseif tonumber(weap6) and tonumber(ammo5) then 
      giveWeapon(player, weap5, ammo5) 
  elseif tonumber(weap6) and tonumber(ammo6) then 
      giveWeapon(player, weap6, ammo6) 
  elseif tonumber(weap7) and tonumber(ammo7) then 
      giveWeapon(player, weap7, ammo7) 
  elseif tonumber(weap8) and tonumber(ammo8) then 
      giveWeapon(player, weap8, ammo8) 
  elseif tonumber(weap9) and tonumber(ammo9) then 
      giveWeapon(player, weap9, ammo9) 
    elseif tonumber(weap10) then 
      giveWeapon(player, weap10, 30) 
    elseif tonumber(weap11) then 
      giveWeapon(player, weap11, 30) 
    elseif tonumber(weap12) then 
      giveWeapon(player, weap12, 10) 
      end 
  end 
end 
  
  
  
  
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, -- s8) -->) 
    setAccountData(playeraccount, "s.ammo8", getPedTotalAmmo(source, -- s8) -->) 
    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
اخي يا ريت تساعدني في هاي كمان

انة ما يحفظ الاسلحة لما يطلع

function onSelectTeam(player) 
  if not isElement(player) then 
    return  
  end 
  local playerTeam = getPlayerTeam(player) 
  showTextForPlayer(player, 5000, 255, 0, 0, 1.5, "You have been assigned to team [" .. tostring(getTeamName(playerTeam)) .. "]") 
  OutPut("To return to spawn press["..Key.."]", player, 255, 255, 255) 
  local playeraccount = getPlayerAccount(player) 
  if playeraccount and not isGuestAccount(getPlayerAccount(player)) then 
    if getElementData(player, "hjwalah") == true then 
      return false 
    end 
    if getElementData(player, "wasgied") == true then 
      return false 
    end 
    setElementData(player, "wasgied", true) 
    local weap0 = getAccountData(playeraccount, "s.weap0") 
    local weap1 = getAccountData(playeraccount, "s.weap1") 
    local weap2 = getAccountData(playeraccount, "s.weap2") 
    local ammo2 = getAccountData(playeraccount, "s.ammo2") 
    local weap3 = getAccountData(playeraccount, "s.weap3") 
    local ammo3 = getAccountData(playeraccount, "s.ammo3") 
    local weap4 = getAccountData(playeraccount, "s.weap4") 
    local ammo4 = getAccountData(playeraccount, "s.ammo4") 
    local weap5 = getAccountData(playeraccount, "s.weap5") 
    local ammo5 = getAccountData(playeraccount, "s.ammo5") 
    local weap6 = getAccountData(playeraccount, "s.weap6") 
    local ammo6 = getAccountData(playeraccount, "s.ammo6") 
    local weap7 = getAccountData(playeraccount, "s.weap7") 
    local ammo7 = getAccountData(playeraccount, "s.ammo7") 
    local weap8 = getAccountData(playeraccount, "s.weap8") 
    local ammo8 = getAccountData(playeraccount, "s.ammo8") 
    local weap9 = getAccountData(playeraccount, "s.weap9") 
    local ammo9 = getAccountData(playeraccount, "s.ammo9") 
    local weap10 = getAccountData(playeraccount, "s.weap10") 
    local weap11 = getAccountData(playeraccount, "s.weap11") 
    local weap12 = getAccountData(playeraccount, "s.weap12") 
    local wanted = getAccountData(playeraccount, "WantedLevel") 
    if tonumber(wanted) then 
      setPlayerWantedLevel(player, wanted) 
   elseif tonumber(weap0) then 
      giveWeapon(player, weap0, 1) 
  elseif tonumber(weap1) then 
      giveWeapon(player, weap1, 1) 
  elseif tonumber(weap2) and tonumber(ammo2) then 
      giveWeapon(player, weap2, ammo2) 
  elseif tonumber(weap3) and tonumber(ammo3) then 
      giveWeapon(player, weap3, ammo3) 
  elseif tonumber(weap4) and tonumber(ammo4) then 
      giveWeapon(player, weap4, ammo4) 
  elseif tonumber(weap6) and tonumber(ammo5) then 
      giveWeapon(player, weap5, ammo5) 
  elseif tonumber(weap6) and tonumber(ammo6) then 
      giveWeapon(player, weap6, ammo6) 
  elseif tonumber(weap7) and tonumber(ammo7) then 
      giveWeapon(player, weap7, ammo7) 
  elseif tonumber(weap8) and tonumber(ammo8) then 
      giveWeapon(player, weap8, ammo8) 
  elseif tonumber(weap9) and tonumber(ammo9) then 
      giveWeapon(player, weap9, ammo9) 
    elseif tonumber(weap10) then 
      giveWeapon(player, weap10, 30) 
    elseif tonumber(weap11) then 
      giveWeapon(player, weap11, 30) 
    elseif tonumber(weap12) then 
      giveWeapon(player, weap12, 10) 
      end 
  end 
end 
  
  
  
  
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, -- s8) -->) 
    setAccountData(playeraccount, "s.ammo8", getPedTotalAmmo(source, -- s8) -->) 
    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

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