Jump to content

طلب تعديل


Recommended Posts

السلام على فى الصافى زون فى مشكلة اللاعب اول ما يكون فى الارض بيعمل عند اللاعب المشكلة اللاعب مبيقدرشى يضرب نار فى اى مكان حتى لو غادر الارض

على العموم الجزء دة هو السبب لما حذفتة انحلت مشكلة بس انا عايز اللاعب ما يقدر يضرب نار فى الارض فى الزون واما يغادر الارض يقدر يضرب عادى "

"يضرب نار يعنى يضرب بى الاسلحة

الاكواد الحالية ى بتخلى اللاعب اول ما يكون فى الزون ما يقدر يضرب نار فى اى مكان

  
--COPY ALL OF THIS BUT CHANGE, radar1, zone1, enterArea1, warp1, displayTimer1, (And sometimes the "function.addAccount")-- 
radar1 = createRadarArea(84, 1774,320,370,0,255,0, 100) 
setElementData(radar1,"zombieProof",true) 
Zone1 = createColRectangle (84, 1774,320,370) 
  
addEventHandler("onColShapeHit", Zone1, 
function(h) 
    if not isElement(h) then return end 
    if getElementData(h,"zombie") then killPed(h) end --These zones are also zombie proof 
end) 
  
function enterArea1(thePlayer) 
     local posX, posY = getElementPosition(thePlayer) 
     local inArea = isInsideRadarArea(radar1, posX, posY) 
     if (inArea) then 
          if hasObjectPermissionTo(thePlayer, "function.addAccount", false) then --Specify who can enter the zone 
               primaryWeaponControl = isControlEnabled ( thePlayer, "fire" ) 
               if ( primaryWeaponControl == true ) then 
                   toggleControl ( thePlayer, "fire", false ) -- change to true/false to allow/disallow shooting. 
                   outputChatBox("***Safe Zone***", thePlayer, 0, 255, 0, true) 
               end 
          else 
               triggerClientEvent(thePlayer, "displayTimer1", thePlayer) 
          end 
     end 
end 
addEventHandler("onColShapeHit", Zone1, enterArea1) 
  

Link to comment
  
--COPY ALL OF THIS BUT CHANGE, radar1, zone1, enterArea1, warp1, displayTimer1, (And sometimes the "function.addAccount")-- 
radar1 = createRadarArea(84, 1774,320,370,0,255,0, 100) 
setElementData(radar1,"zombieProof",true) 
Zone1 = createColRectangle (84, 1774,320,370) 
  
addEventHandler("onColShapeHit", Zone1, 
function(h) 
    if not isElement(h) then return end 
    if getElementData(h,"zombie") then killPed(h) end --These zones are also zombie proof 
end) 
  
function enterArea1(thePlayer) 
     local posX, posY = getElementPosition(thePlayer) 
     local inArea = isInsideRadarArea(radar1, posX, posY) 
     if (inArea) then 
          if hasObjectPermissionTo(thePlayer, "function.addAccount", false) then --Specify who can enter the zone 
               --primaryWeaponControl = isControlEnabled ( thePlayer, "fire" ) 
               --if ( primaryWeaponControl == true ) then 
                   toggleControl ( thePlayer, "fire", not isControlEnabled ( thePlayer, "fire" ) ) -- change to true/false to allow/disallow shooting. 
                   outputChatBox("***Safe Zone***", thePlayer, 0, 255, 0, true) 
               --end 
          else 
               triggerClientEvent(thePlayer, "displayTimer1", thePlayer) 
          end 
     end 
end 
addEventHandler("onColShapeHit", Zone1, enterArea1) 
  

Link to comment
  
--COPY ALL OF THIS BUT CHANGE, radar1, zone1, enterArea1, warp1, displayTimer1, (And sometimes the "function.addAccount")-- 
radar1 = createRadarArea(84, 1774,320,370,0,255,0, 100) 
setElementData(radar1,"zombieProof",true) 
Zone1 = createColRectangle (84, 1774,320,370) 
  
addEventHandler("onColShapeHit", Zone1, 
function(h) 
    if not isElement(h) then return end 
    if getElementData(h,"zombie") then killPed(h) end --These zones are also zombie proof 
end) 
  
function enterArea1(thePlayer) 
     local posX, posY = getElementPosition(thePlayer) 
     local inArea = isInsideRadarArea(radar1, posX, posY) 
     if (inArea) then 
          if hasObjectPermissionTo(thePlayer, "function.addAccount", false) then --Specify who can enter the zone 
               --primaryWeaponControl = isControlEnabled ( thePlayer, "fire" ) 
               --if ( primaryWeaponControl == true ) then 
                   toggleControl ( thePlayer, "fire", not isControlEnabled ( thePlayer, "fire" ) ) -- change to true/false to allow/disallow shooting. 
                   outputChatBox("***Safe Zone***", thePlayer, 0, 255, 0, true) 
               --end 
          else 
               triggerClientEvent(thePlayer, "displayTimer1", thePlayer) 
          end 
     end 
end 
addEventHandler("onColShapeHit", Zone1, enterArea1) 
  

تقريبا السيف زون دة بتاع زومبى شى اخير نسيت اكتة اللاعب ما يقدر يموت فى الارض عشان نسيت اكتبها

لان ممكن حد من برة الارض يضرب نار عليهم يموتهم

--

لسا مجربة الان التعديل الى انت عملتة نفس المشكلة خلاص هشوف انا زون غيروة

يقدر يضرب نار بس اما اللاعب يموت بعد خروجة من الارض

--

لقيت واحد على النت اسمة جرين زون

الزون الاغضر لكن مشكلتة اما بعدل على اللون واختار اى لون غير اغضر قطعة الارض

الزون مش بيشتغل بيبقى عبارة عن قطعة ارض بس لكن اقدر اموت فيها واضرب نار اما بختار لون غير اغضر

ينفع تعدلى عليها بحيث اقدر اغير اللون وما يخرب الزون....ولو ماينفع مافى مشكلة كويس انى لقيتة اصلا

addEventHandler ("onResourceStart", getRootElement(),  
function() 
  setTimer (moneyZoneTimerFunction, 2500, 0) 
  local allGreenzones = getElementsByType ("radararea") 
  for i,v in ipairs (allGreenzones) do 
    local r,g,b,a = getRadarAreaColor (v) 
    if (r == 0) and (g == 255) and (b == 0) and (a == 127) then 
      local x,y = getElementPosition (v) 
      local sx,sy = getRadarAreaSize (v) 
      local col = createColCuboid (x,y, -50, sx,sy, 7500) 
      setElementID (col, "greenzoneColshape") 
    end 
  end 
end) 
  
addEventHandler ("onColShapeHit", getRootElement(),  
function(hitElement, matchingDimension) 
  if (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then 
    outputChatBox ("You entered the greenzone", hitElement, 255, 0, 0, false) 
    toggleControl (hitElement, "fire", false) 
    toggleControl (hitElement, "next_weapon", false) 
    toggleControl (hitElement, "previous_weapon", false) 
    toggleControl (hitElement, "sprint", false) 
    toggleControl (hitElement, "aim_weapon", false) 
    toggleControl (hitElement, "vehicle_fire", false) 
    showPlayerHudComponent (hitElement, "ammo", false) 
    showPlayerHudComponent (hitElement, "weapon", false) 
    triggerClientEvent (hitElement, "enableGodMode", hitElement) 
  end 
  if (source == moneyZoneCol) and (getElementType (hitElement) == "vehicle") then 
    setElementVelocity (hitElement, 0, 0, 0) 
    setElementPosition (hitElement, 2018.33, 1534.77, 12.37) 
    setVehicleRotation (hitElement, 0,0,270) 
    if (getVehicleOccupant (hitElement, 0)) then 
      outputChatBox ("You can't enter the moneyzone with your car!", getVehicleOccupant (hitElement, 0), 255, 0, 0, false) 
    end 
  end 
end) 
  
addEventHandler ("onColShapeLeave", getRootElement(),  
function(leaveElement, matchingDimension) 
  if (getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then 
    outputChatBox ("You left the greenzone", leaveElement, 255, 0, 0, false) 
    toggleControl (leaveElement, "fire", true) 
    toggleControl (leaveElement, "next_weapon", true) 
    toggleControl (leaveElement, "previous_weapon", true) 
    toggleControl (leaveElement, "sprint", true) 
    toggleControl (leaveElement, "aim_weapon", true) 
    toggleControl (leaveElement, "vehicle_fire", true) 
    showPlayerHudComponent (leaveElement, "ammo", true) 
    showPlayerHudComponent (leaveElement, "weapon", true) 
    triggerClientEvent (leaveElement, "disableGodMode", leaveElement) 
  end 
end) 
  
--money zone col 
moneyZoneCol = createColCuboid (1993.12, 1519.14, -100, 17.43, 54.24, 117) 
--stop moneyzone col 
  
function moneyZoneTimerFunction () 
  local allPlayersInCol = getElementsWithinColShape (moneyZoneCol, "player") 
  for i,v in ipairs (allPlayersInCol) do 
    givePlayerMoney (v, 5) 
  end 
end 
  
-- marker bij hospital 
createMarker (1607.36, 1814.24, -10, "cylinder", 24, 0, 255, 0, 190, getRootElement()) 

  <radararea posX="1577.65" posY="1723.59" sizeX="59.46" sizeY="139.45" color="#00FF007F" dimension="0" /> 

Edited by Guest
Link to comment

local r, g, b, a = 0, 255, 0, 255 -- عدل اللون هنا 
  
local colshape = createColCuboid (1577.65, 1723.59, -50, 59.46, 139.45, 100) 
createRadarArea (1577.65, 1723.59, 59.46, 139.45, r, g, b, a) 
  
addEventHandler ("onColShapeHit", colshape,  
    function (hit) 
        if getElementType (hit) == "ped" then 
            if getElementData (hit, "zombie") then 
                killPed (hit) 
            end 
        end 
        if getElementType (hit) == "player" then 
            toggleControl (hit, "fire", false) 
            toggleControl (hit, "aim_weapon", false) 
            toggleControl (hit, "next_weapon", false) 
            toggleControl (hit, "previous_weapon", false) 
            toggleControl (hit, "sprint", false) 
        end 
    end 
) 
  
addEventHandler ("onColShapeLeave", colshape,  
    function (left) 
        if getElementType (left) == "player" then 
            toggleControl (left, "fire", true) 
            toggleControl (left, "aim_weapon", true) 
            toggleControl (left, "next_weapon", true) 
            toggleControl (left, "previous_weapon", true) 
            toggleControl (left, "sprint", true) 
        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...