Jump to content

ابي كود منطقه محميه


baba

Recommended Posts

سلام عليكم شباب

لو سمحتو رح اتعبكم معي

ابي كود منطقه محميه من

السلحه

+

سياره

_________________

يعني اذا حد دخل وحاط في ايده سلاح يختفي ويطلع بدال السلاح ايدو

واذا دخل واحد في المنطقه المحميه ومعاه سياره تختفي

وارجو التوضيح

___________

بتوفيق انشاء الله

Link to comment

جرب

createColSphere(x,y,z,1)              -------------------------  حدد الحجم  
function onColShapeHit (player) 
if element and getElementType(element) == "player" then 
takeWeapon ( thePlayer, 0 ) ---------------------- هنا حطات فقط يستعمل البقس  
local vehicle = getPedOccupiedVehicle ( source ) 
destroyElement(vehicle) 
addEventHandler ( "onColShapeHit", turf[id].col, onColShapeHit ) 

Link to comment
جرب
createColSphere(x,y,z,1)              -------------------------  حدد الحجم  
function onColShapeHit (player) 
if element and getElementType(element) == "player" then 
takeWeapon ( thePlayer, 0 ) ---------------------- هنا حطات فقط يستعمل البقس  
local vehicle = getPedOccupiedVehicle ( source ) 
destroyElement(vehicle) 
addEventHandler ( "onColShapeHit", turf[id].col, onColShapeHit ) 

Oops ^ *_* !!

Link to comment

سيرفر

createColSphere(-6399.22754,472.36685,6.91622,1)              -------------------------  حدد الحجم 
function onColShapeHit (player) 
if element and getElementType(element) == "player" then 
takeWeapon ( thePlayer, 0 ) ---------------------- هنا حطات فقط يستعمل البقس 
local vehicle = getPedOccupiedVehicle ( source ) 
destroyElement(vehicle) 
addEventHandler ( "onColShapeHit", turf[id].col, onColShapeHit ) 

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

Link to comment
-- create our hill area for our gamemode 
local hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 ) 
  
-- add hill_Enter as a handler for when a player enters the hill area 
function hill_Enter ( thePlayer, matchingDimension ) 
        if getElementType ( thePlayer ) == "player" then --if the element that entered was player 
                --let's get the name of the player 
                local nameOfThePlayer = getPlayerName ( thePlayer ) 
            --announce to everyone that the player entered the hill 
            outputChatBox ( nameOfThePlayer.." entered the zone!", getRootElement(), 255, 255, 109 ) 
        end 
end 
addEventHandler ( "onColShapeHit", hillArea, hill_Enter ) 
  
-- add hill_Enter as a handler for when a player leaves the hill area 
function hill_Exit ( thePlayer, matchingDimension ) 
        if getElementType ( thePlayer ) == "player" then --if the element that left was player 
            --check if the player is not dead 
            if isPlayerDead ( thePlayer ) ~= true then 
                        --let's get the name of the player 
                        local nameOfThePlayer = getPlayerName ( thePlayer ) 
                --if he was alive, announce to everyone that the player has left the hill 
                outputChatBox ( nameOfThePlayer.." left the zone!", getRootElement(), 255, 255, 109 ) 
            end 
        end 
end 
addEventHandler ( "onColShapeLeave", hillArea, hill_Exit ) 

ممكن توضحو لي؟

Link to comment

local col = createColCuboid( x, y, z, width, depth, height ) 
  
addEventHandler ("onColShapeHit", col, function (hitElement) 
  if getElementType (hitElement) == "player" then 
      if isPedInVehicle (hitElement) then 
          local veh = getPedOccupiedVehicle (hitElement) 
          destroyElement (veh) 
          outputChatBox ("You can't enter wth your vehicle.", hitElement, 255, 0, 0) 
          toggleControl (hitElement, "fire", false) 
          toggleControl (hitElement, "aim_weapon", false) 
          setPedWeaponSlot (hitElement, 0) 
          toggleControl (hitElement, "next_weapon", false) 
          toggleControl (hitElement, "previous_weapon", false) 
      else 
          toggleControl (hitElement, "fire", false) 
          toggleControl (hitElement, "aim_weapon", false) 
          setPedWeaponSlot (hitElement, 0) 
          toggleControl (hitElement, "next_weapon", false) 
          toggleControl (hitElement, "previous_weapon", false) 
       end 
   end 
end 
) 
  
addEventHandler ("onColShapeLeave", col, function (leaveElement) 
 if getElementType (leaveElement) == "player" then 
     toggleControl (leaveElement, "fire", true) 
     toggleControl (leaveElement, "aim_weapon", true) 
     toggleControl (leaveElement, "next_weapon", true) 
     toggleControl (leaveElement, "previous_weapon", 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...