Jump to content

ساعدوني بي مود الحماية


Recommended Posts

شباب

معي مود حماية

بس الحماية حماية من كل شئ عدا السيارات لها حماية وحدها

والسيارات محمية بي هاي الفنكشن

createColCuboid 

ابي احد يعرفني كيف اخد احداثيات بي هاي الفنكشن

او تقولولي كيف اخلي الحماية العاديه معها حماية سيارات

اتمني تساعدوني وشكرا

Link to comment
شباب

معي مود حماية

بس الحماية حماية من كل شئ عدا السيارات لها حماية وحدها

والسيارات محمية بي هاي الفنكشن

createColCuboid 

ابي احد يعرفني كيف اخد احداثيات بي هاي الفنكشن

او تقولولي كيف اخلي الحماية العاديه معها حماية سيارات

اتمني تساعدوني وشكرا

 

  
 getElementType --(vehicle) 
destroyElement 
  

Link to comment
شباب

معي مود حماية

بس الحماية حماية من كل شئ عدا السيارات لها حماية وحدها

والسيارات محمية بي هاي الفنكشن

createColCuboid 

ابي احد يعرفني كيف اخد احداثيات بي هاي الفنكشن

او تقولولي كيف اخلي الحماية العاديه معها حماية سيارات

اتمني تساعدوني وشكرا

 

  
 getElementType --(vehicle) 
destroyElement 
  

if getElementType (Vehicle) then 
      destroyElement (Vehicle) 

سويته هيك وما اشتغل

Link to comment

عشان تخلي السيارة تختفي

  
--Events 
onColShapeHit 
--functions 
getPedOccupiedVehicle or getElementType 
destroyElement 

ذي طريقه للـتاكد من الاحداثيات

createColRectangle -- الكول شيب 
createRadarArea --تتاكد من الاحداثيات سويها نفس احداثيات الكول شيب 

مثال موضحلك فيه

createColRectangle ( x, y, width, height ) 

createRadarArea ( x, y, width, height, color, color, color, alpha ) 

Edited by Guest
Link to comment
if getElementType (Vehicle) then 
      destroyElement (Vehicle) 

سويته هيك وما اشتغل

التصحيح

if getElementType (Vehicle) == "vehicle" then destroyElement (Vehicle) end 

+تأكد من الارقمنت Vehicle

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()) 

بصراحة انا لغبط

علي العموم هاي هي الاكواد

شوفها لاني مب فاهمك نيح

Link to comment

جرب

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 
    if not getElementType (hitElement) == "vehicle" 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) 
    else 
    destroyElement (hitElement) 
  end 
  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()) 

Link to comment

function onColShapeEvent( theElement ) 
    local theElementType = getElementType( theElement ) 
    if ( getElementID( source ) == "greenzoneColshape" ) then 
        if ( theElementType == "player" ) then 
            local State = not ( eventName == "onColShapeHit" ) 
            for _, Control in ipairs( { "fire", "next_weapon", "previous_weapon", "sprint", "aim_weapon", "vehicle_fire" } ) do 
                toggleControl( theElement, Control, State ) 
            end 
            for _, Hud in ipairs( { "ammo", "weapon" } ) do showPlayerHudComponent( theElement, Hud, State ) end 
            triggerClientEvent( theElement, ( State and "dis" or "en" ).."ableGodMode", theElement ) 
        elseif ( theElementType == "vehicle" ) then 
            destroyElement( theElement ) 
        end 
    elseif ( source == moneyZoneCol and eventName == "onColShapeHit" and theElementType == "vehicle" ) then 
        setElementVelocity( theElement, 0, 0, 0 ) 
        setElementPosition( theElement, 2018.33, 1534.77, 12.37 ) 
        setElementRotation( theElement, 0, 0, 270 ) 
        local Player = getVehicleOccupant( theElement, 0 ) 
        if ( Player ) then outputChatBox( "You can't enter the moneyzone with your car!", Player, 255, 0, 0 ) end 
    end 
end 
addEventHandler( "onColShapeHit", root, onColShapeEvent ) 
addEventHandler( "onColShapeLeave", root, onColShapeEvent ) 
Link to comment
جرب
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 
    if not getElementType (hitElement) == "vehicle" 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) 
    else 
    destroyElement (hitElement) 
  end 
  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()) 

المود خرب

في خطاء في الكود

لان اللاعب صار يموت

Link to comment
function onColShapeEvent( theElement ) 
    local theElementType = getElementType( theElement ) 
    if ( getElementID( source ) == "greenzoneColshape" ) then 
        if ( theElementType == "player" ) then 
            local State = not ( eventName == "onColShapeHit" ) 
            for _, Control in ipairs( { "fire", "next_weapon", "previous_weapon", "sprint", "aim_weapon", "vehicle_fire" } ) do 
                toggleControl( theElement, Control, State ) 
            end 
            for _, Hud in ipairs( { "ammo", "weapon" } ) do showPlayerHudComponent( theElement, Hud, State ) end 
            triggerClientEvent( theElement, ( State and "dis" or "en" ).."ableGodMode", theElement ) 
        elseif ( theElementType == "vehicle" ) then 
            destroyElement( theElement ) 
        end 
    elseif ( source == moneyZoneCol and eventName == "onColShapeHit" and theElementType == "vehicle" ) then 
        setElementVelocity( theElement, 0, 0, 0 ) 
        setElementPosition( theElement, 2018.33, 1534.77, 12.37 ) 
        setElementRotation( theElement, 0, 0, 270 ) 
        local Player = getVehicleOccupant( theElement, 0 ) 
        if ( Player ) then outputChatBox( "You can't enter the moneyzone with your car!", Player, 255, 0, 0 ) end 
    end 
end 
addEventHandler( "onColShapeHit", root, onColShapeEvent ) 
addEventHandler( "onColShapeLeave", root, onColShapeEvent ) 

نفس الموضوع بردو اللاعب صار يموت في المنطقة

والمود خرب

وما صار هناك حماية

Link to comment
function onColShapeEvent( theElement ) 
    local theElementType = getElementType( theElement ) 
    if ( getElementID( source ) == "greenzoneColshape" ) then 
        if ( theElementType == "player" ) then 
            local State = not ( eventName == "onColShapeHit" ) 
            for _, Control in ipairs( { "fire", "next_weapon", "previous_weapon", "sprint", "aim_weapon", "vehicle_fire" } ) do 
                toggleControl( theElement, Control, State ) 
            end 
            for _, Hud in ipairs( { "ammo", "weapon" } ) do showPlayerHudComponent( theElement, Hud, State ) end 
            triggerClientEvent( theElement, ( State and "dis" or "en" ).."ableGodMode", theElement ) 
        elseif ( theElementType == "vehicle" ) then 
            destroyElement( theElement ) 
        end 
    elseif ( source == moneyZoneCol and eventName == "onColShapeHit" and theElementType == "vehicle" ) then 
        setElementVelocity( theElement, 0, 0, 0 ) 
        setElementPosition( theElement, 2018.33, 1534.77, 12.37 ) 
        setElementRotation( theElement, 0, 0, 270 ) 
        local Player = getVehicleOccupant( theElement, 0 ) 
        if ( Player ) then outputChatBox( "You can't enter the moneyzone with your car!", Player, 255, 0, 0 ) end 
    end 
end 
addEventHandler( "onColShapeHit", root, onColShapeEvent ) 
addEventHandler( "onColShapeLeave", root, onColShapeEvent ) 

نفس الموضوع بردو اللاعب صار يموت في المنطقة

والمود خرب

وما صار هناك حماية

اطرح كود السيرفر كامل بعد ما حطيت كودي + الكلنت

Link to comment

السيرفر

function onColShapeEvent( theElement ) 
    local theElementType = getElementType( theElement ) 
    if ( getElementID( source ) == "greenzoneColshape" ) then 
        if ( theElementType == "player" ) then 
            local State = not ( eventName == "onColShapeHit" ) 
            for _, Control in ipairs( { "fire", "next_weapon", "previous_weapon", "sprint", "aim_weapon", "vehicle_fire" } ) do 
                toggleControl( theElement, Control, State ) 
            end 
            for _, Hud in ipairs( { "ammo", "weapon" } ) do showPlayerHudComponent( theElement, Hud, State ) end 
            triggerClientEvent( theElement, ( State and "dis" or "en" ).."ableGodMode", theElement ) 
        elseif ( theElementType == "vehicle" ) then 
            destroyElement( theElement ) 
        end 
    elseif ( source == moneyZoneCol and eventName == "onColShapeHit" and theElementType == "vehicle" ) then 
        setElementVelocity( theElement, 0, 0, 0 ) 
        setElementPosition( theElement, 2018.33, 1534.77, 12.37 ) 
        setElementRotation( theElement, 0, 0, 270 ) 
        local Player = getVehicleOccupant( theElement, 0 ) 
        if ( Player ) then outputChatBox( "You can't enter the moneyzone with your car!", Player, 255, 0, 0 ) end 
    end 
end 
addEventHandler( "onColShapeHit", root, onColShapeEvent ) 
addEventHandler( "onColShapeLeave", root, onColShapeEvent ) 

الكلينكت

addEvent("enableGodMode", true) 
addEvent("disableGodMode", true) 
addEventHandler ("enableGodMode", getRootElement(),  
function() 
  addEventHandler ("onClientPlayerDamage", getRootElement(), cancelEventEvent) 
end) 
  
addEventHandler ("disableGodMode", getRootElement(),  
function() 
  removeEventHandler ("onClientPlayerDamage", getRootElement(), cancelEventEvent) 
end) 
  
function cancelEventEvent () cancelEvent() end  
  
--liedje in piratenschip 
pirShipMusicCol = createColCuboid (1997.58,1523.16,8,6,17.66,4) 
addEventHandler ("onClientColShapeHit", getRootElement(),  
function(hitElement, matchingDimension) 
  if (source == pirShipMusicCol) and (hitElement == getLocalPlayer()) then 
    setRadioChannel (7) 
  end 
end) 
addEventHandler ("onClientColShapeLeave", getRootElement(),  
function(leaveElement, matchingDimension) 
  if (source == pirShipMusicCol) and (leaveElement == getLocalPlayer()) then 
    setRadioChannel (0) 
  end 
end) 

Link to comment
السيرفر
function onColShapeEvent( theElement ) 
    local theElementType = getElementType( theElement ) 
    if ( getElementID( source ) == "greenzoneColshape" ) then 
        if ( theElementType == "player" ) then 
            local State = not ( eventName == "onColShapeHit" ) 
            for _, Control in ipairs( { "fire", "next_weapon", "previous_weapon", "sprint", "aim_weapon", "vehicle_fire" } ) do 
                toggleControl( theElement, Control, State ) 
            end 
            for _, Hud in ipairs( { "ammo", "weapon" } ) do showPlayerHudComponent( theElement, Hud, State ) end 
            triggerClientEvent( theElement, ( State and "dis" or "en" ).."ableGodMode", theElement ) 
        elseif ( theElementType == "vehicle" ) then 
            destroyElement( theElement ) 
        end 
    elseif ( source == moneyZoneCol and eventName == "onColShapeHit" and theElementType == "vehicle" ) then 
        setElementVelocity( theElement, 0, 0, 0 ) 
        setElementPosition( theElement, 2018.33, 1534.77, 12.37 ) 
        setElementRotation( theElement, 0, 0, 270 ) 
        local Player = getVehicleOccupant( theElement, 0 ) 
        if ( Player ) then outputChatBox( "You can't enter the moneyzone with your car!", Player, 255, 0, 0 ) end 
    end 
end 
addEventHandler( "onColShapeHit", root, onColShapeEvent ) 
addEventHandler( "onColShapeLeave", root, onColShapeEvent ) 

-_- ما قلت لك شيل باقي أكواد السيرفر

# -- Server

addEventHandler( "onResourceStart", resourceRoot, 
function() 
    moneyZoneCol = createColCuboid( 1993.12, 1519.14, -100, 17.43, 54.24, 117 ) 
    createMarker( 1607.36, 1814.24, -10, "cylinder", 24, 0, 255, 0, 190 ) 
    setTimer( 
        function() 
            for _, Player in ipairs( getElementsWithinColShape( moneyZoneCol, "player" ) ) do givePlayerMoney( Player, 5 ) end 
        end, 
    2500, 0 ) 
    for _, Player in ipairs( getElementsByType( "player" ) ) do setElementData( Player, "Protected", false ) end 
    for _, RadarArea in ipairs( getElementsByType( "radararea" ) ) do 
        local Colors = { getRadarAreaColor( RadarArea ) } 
        if ( Colors[1] == 0 and Colors[2] == 255 and Colors[3] == 0 and Colors[4] == 127 ) then 
            local Position, Size = { getElementPosition( RadarArea ) }, { getRadarAreaSize( RadarArea ) } 
            setElementID( createColCuboid( Position[1], Position[2], -50, Size[1], Size[2], 7500 ), "greenzoneColshape" ) 
        end 
    end 
end ) 
  
function onColShapeEvent( theElement ) 
    local theElementType = getElementType( theElement ) 
    if ( getElementID( source ) == "greenzoneColshape" ) then 
        if ( theElementType == "player" ) then 
            local State = not ( eventName == "onColShapeHit" ) 
            for _, Control in ipairs( { "fire", "next_weapon", "previous_weapon", "sprint", "aim_weapon", "vehicle_fire" } ) do 
                toggleControl( theElement, Control, State ) 
            end 
            for _, Hud in ipairs( { "ammo", "weapon" } ) do showPlayerHudComponent( theElement, Hud, State ) end 
            setElementData( theElement, "Protected", not State ) 
        elseif ( theElementType == "vehicle" ) then 
            destroyElement( theElement ) 
        end 
    elseif ( source == moneyZoneCol and eventName == "onColShapeHit" and theElementType == "vehicle" ) then 
        setElementVelocity( theElement, 0, 0, 0 ) 
        setElementPosition( theElement, 2018.33, 1534.77, 12.37 ) 
        setElementRotation( theElement, 0, 0, 270 ) 
        local Player = getVehicleOccupant( theElement, 0 ) 
        if ( Player ) then outputChatBox( "You can't enter the moneyzone with your car!", Player, 255, 0, 0 ) end 
    end 
end 
addEventHandler( "onColShapeHit", root, onColShapeEvent ) 
addEventHandler( "onColShapeLeave", root, onColShapeEvent ) 

# -- Client

pirShipMusicCol = createColCuboid( 1997.58, 1523.16, 8, 6, 17.66, 4 ) 
  
addEventHandler( "onClientElementDataChange", localPlayer, 
function( DataName, OldValue ) 
    if ( DataName == "Protected" ) then 
        local NewValue = getElementData( source, DataName ) 
        if ( NewValue ~= OldValue ) then _G[( NewValue and "add" or "remove" ).."EventHandler"]( "onClientPlayerDamage", source, cancelEvent ) end 
    end 
end ) 
  
function RadioChannel( theElement ) if ( theElement == localPlayer ) then setRadioChannel( eventName == "onClientColShapeHit" and 7 or 0 ) end end 
addEventHandler( "onClientColShapeHit", pirShipMusicCol, RadioChannel ) 
addEventHandler( "onClientColShapeLeave", pirShipMusicCol, RadioChannel ) 
Link to comment

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 
    local theVehicle = getPedOccupiedVehicle ( hitElement ) 
    if theVehicle then destroyElement(theVehicle) end 
    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 
  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) 
  
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()) 

جرب

Link to comment
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 
    local theVehicle = getPedOccupiedVehicle ( hitElement ) 
    if theVehicle then destroyElement(theVehicle) end 
    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 
  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) 
  
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()) 

جرب

نفس الموضوع

Link to comment
-- Server Side !
SafahM = createMarker ( x, y, z, "cylinder", size, 0, 0, 0, 0 ) 
  
addEventHandler ( "onMarkerHit", SafahM, 
    function ( hitPlayer ) 
        if getElementType ( hitPlayer ) == "player" then 
            toggleControl ( hitPlayer, "fire", false ) 
        elseif getElementType ( hitPlayer ) == "vehicle" then 
            local Player = getVehicleController ( hitPlayer ) 
            outputChatBox ( "* ممنوع دخول المواتر هنا !", Player, 255, 0, 0, true ) 
            destroyElement ( hitPlayer ) 
        end 
    end 
) 
  
addEventHandler ( "onMarkerLeave", SafahM, 
    function ( leftPlayer ) 
        if getElementType ( leftPlayer ) == "player" then 
            toggleControl ( leftPlayer, "fire", true ) 
        end 
    end 
) 

الإستبدآل في السطر الأول فقط ,

x, y, z = إحداثيات الماركر !

size = حجم الماركر !

Link to comment
-- Server Side !
SafahM = createMarker ( x, y, z, "cylinder", size, 0, 0, 0, 0 ) 
  
addEventHandler ( "onMarkerHit", SafahM, 
    function ( hitPlayer ) 
        if getElementType ( hitPlayer ) == "player" then 
            toggleControl ( hitPlayer, "fire", false ) 
        elseif getElementType ( hitPlayer ) == "vehicle" then 
            local Player = getVehicleController ( hitPlayer ) 
            outputChatBox ( "* ممنوع دخول المواتر هنا !", Player, 255, 0, 0, true ) 
            destroyElement ( hitPlayer ) 
        end 
    end 
) 
  
addEventHandler ( "onMarkerLeave", SafahM, 
    function ( leftPlayer ) 
        if getElementType ( leftPlayer ) == "player" then 
            toggleControl ( leftPlayer, "fire", true ) 
        end 
    end 
) 

الإستبدآل في السطر الأول فقط ,

x, y, z = إحداثيات الماركر !

size = حجم الماركر !

size = حجم الماركر

برستيج انا جربت طلعsize

الوان مو حجم جربته غيرت فيه مو راضيه تكبر بس يتغير لوهه

وش الوضع

Link to comment

SafahM = createMarker ( x, y, z, "cylinder", size, 0, 0, 0, 0 ) 
-- x,y,z = الاحداثيات  
-- "cylinder" = شكل الماركر  
-- size = حجم الماركر 
-- 0,0,0,0 = الوان الماركر 
  
-- بمـآ ان الشفافية 0 فـ ما راح يظهر لك 
  
-- ولو تبيه يظهر تحطه كذا  
  
-- 255,255,255,255 
  
-- يصير كذا 
  
SafahM = createMarker ( x, y, z, "cylinder", size, 255,255,255,255 ) 
  
Link to comment
SafahM = createMarker ( x, y, z, "cylinder", size, 0, 0, 0, 0 ) 
-- x,y,z = الاحداثيات  
-- "cylinder" = شكل الماركر  
-- size = حجم الماركر 
-- 0,0,0,0 = الوان الماركر 
  
-- بمـآ ان الشفافية 0 فـ ما راح يظهر لك 
  
-- ولو تبيه يظهر تحطه كذا  
  
-- 255,255,255,255 
  
-- يصير كذا 
  
SafahM = createMarker ( x, y, z, "cylinder", size, 255,255,255,255 ) 
  

اها مشكور اخي خالد على الرد

انا حسبت الاصفار هي الحجم ^(^ مشكور م قصرت

موفق ي رب انت و برستيج و كل العيال

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