MTASA TÜRK
Türkiye'nin En Güncel MTA Platformu


[YARDIM] Greenzone Hatası

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
: 14 Nisan 2018, 11:45:28
Beyler kolay gelsin greenzone ye girince god gecmıyor bakarmsınız yanı sıkabılıyosun ve oluyosun yardımcı olurmusunuz.

Kod: lua
addEventHandler ("onResourceStart", getRootElement(), 
function()
  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 (getElementID (source) == "greenzoneColshape")  and (getElementType (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", true)
    toggleControl (hitElement, "aim_weapon", false)
    toggleControl (hitElement, "vehicle_fire", false)
    showPlayerHudComponent (hitElement, "ammo", false)
    showPlayerHudComponent (hitElement, "weapon", false)
    triggerClientEvent (hitElement, "enableGodMode", hitElement)
  end
end)

addEventHandler ("onColShapeLeave", getRootElement(),
function(leaveElement, matchingDimension)
  if (getElementID (source) == "greenzoneColshape") and (getElementType (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)
« Son Düzenleme: 15 Nisan 2018, 19:39:04 Gönderen: Narkoz »
 


MTASA TÜRK

[YARDIM] Greenzone Hatası
« : 14 Nisan 2018, 11:45:28 »

Çevrimdışı ertrldtcu

  • Uzman Üye
  • *
    • İleti: 616
Yanıtla #1 : 14 Nisan 2018, 12:00:26
server-side
Kod: lua
addEventHandler("onResourceStart",root,function()
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",root,function(hitElement)
if (getElementID(source) == "greenzoneColshape")  and (getElementType(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,"aim_weapon",false)
toggleControl(hitElement,"vehicle_fire",false)
showPlayerHudComponent(hitElement,"ammo",false)
showPlayerHudComponent(hitElement,"weapon",false)
triggerClientEvent(hitElement,"god",hitElement,true)
end
end)

addEventHandler("onColShapeLeave",root,function(leaveElement)
if (getElementID(source) == "greenzoneColshape") and (getElementType(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,"aim_weapon",true)
toggleControl(leaveElement,"vehicle_fire",true)
showPlayerHudComponent(leaveElement,"ammo",true)
showPlayerHudComponent(leaveElement,"weapon",true)
triggerClientEvent(hitElement,"god",hitElement,false)
end
end)

client-side
Kod: lua
addEvent("god",true)
addEventHandler("god",root,function(god)
if god then
removeEventHandler("onClientPlayerDamage",root,hasarIptal)
addEventHandler("onClientPlayerDamage",root,hasarIptal)
else
removeEventHandler("onClientPlayerDamage",root,hasarIptal)
end
end)

function hasarIptal()
cancelEvent()
end
system
 


Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
Yanıtla #2 : 14 Nisan 2018, 12:04:43
denıyorum hemen

Mesaj Birleştirildi: [time]14 Nisan 2018, 13:15:53[/time]
Linki görebilmek için Kayıt olun yada Giriş yapın. olmadı yeşil alanda sıkabiliyorum ve oluyorum   :(
« Son Düzenleme: 14 Nisan 2018, 12:34:53 Gönderen: cakı11 »
 


Çevrimdışı Mahlukat

  • Scripter
  • *
    • İleti: 638
Yanıtla #3 : 14 Nisan 2018, 22:42:29
serverinde başka scriptlerin içinde togleControl kodu olabilir freeroam scriptini felan kapatıp dener misin ?

veya home serverda dene
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
Yanıtla #4 : 14 Nisan 2018, 22:45:02
serverde hersey kapalı ama yesıl alan geliyor ama god devreye girmiyor

Mesaj Birleştirildi: 14 Nisan 2018, 23:00:47
normalde kod aşyadaki gibiydi warnıg veriyordu sen yukarıya bıraktıgım kodu vermıstın warnıng vermesının sebebide ayrı bir spana arac girmesin diye attıgım sc


Linki görebilmek için Kayıt olun yada Giriş yapın.


Kod: lua
addEventHandler ("onResourceStart", getRootElement(), 
function()
  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 ("", hitElement, 255, 0, 0, false)
    toggleControl (hitElement, "fire", false)
    toggleControl (hitElement, "next_weapon", false)
    toggleControl (hitElement, "previous_weapon", false)
    toggleControl (hitElement, "sprint", true)
    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 ("", 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())
« Son Düzenleme: 14 Nisan 2018, 23:00:47 Gönderen: cakı11 »
 


Çevrimdışı Mahlukat

  • Scripter
  • *
    • İleti: 638
Yanıtla #5 : 14 Nisan 2018, 23:13:02
Kod: lua
addEventHandler ("onResourceStart", getRootElement(), 
function()
  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 (getElementID (source) == "greenzoneColshape")  and (getElementType (source) == "player") 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", true)
    toggleControl (hitElement, "aim_weapon", false)
    toggleControl (hitElement, "vehicle_fire", false)
    showPlayerHudComponent (hitElement, "ammo", false)
    showPlayerHudComponent (hitElement, "weapon", false)
    triggerClientEvent (hitElement, "enableGodMode", hitElement)
  end
end)
 
addEventHandler ("onColShapeLeave", getRootElement(),
function(leaveElement, matchingDimension)
  if (getElementID (source) == "greenzoneColshape") and (getElementType (source) == "player") 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)
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


MTASA TÜRK

Ynt: [YARDIM] Greenzone Hatası
« Yanıtla #5 : 14 Nisan 2018, 23:13:02 »

Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
Yanıtla #6 : 14 Nisan 2018, 23:18:43
hatayı kesiyor ama god gelmiyor bide böyle bir kod hada var icinde client


Kod: lua
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)
 


Çevrimdışı @DeaRSwaT

  • Nitrado Gaming
  • Yeni Üye
  • *
    • İleti: 22
  • Yavaş, yavaş geliyoruz Bekleyin ""Nitrado Gaming""
Yanıtla #7 : 14 Nisan 2018, 23:48:44
Al dene

Kod: lua
addEvent("enableGodMode", true)
addEvent("enableGodMode", true)
addEventHandler ("enableGodMode", getRootElement(),
function()
  addEventHandler ("onClientPlayerDamage", getRootElement(), cancelEventEvent)
end)

addEventHandler ("enableGodMode", 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)
Nitrado Gaming
 


Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
Yanıtla #8 : 15 Nisan 2018, 07:41:35
malesef olmadı
 


Çevrimdışı shephard^

  • Grafiker
  • *
    • İleti: 797
  • decay.
Yanıtla #9 : 15 Nisan 2018, 09:53:18
Başka bir greenzone denesen?
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
Yanıtla #10 : 15 Nisan 2018, 10:46:50
Linki görebilmek için Kayıt olun yada Giriş yapın.
serverde hersey kapalı ama yesıl alan geliyor ama god devreye girmiyor

Mesaj Birleştirildi: 14 Nisan 2018, 23:00:47
normalde kod aşyadaki gibiydi warnıg veriyordu sen yukarıya bıraktıgım kodu vermıstın warnıng vermesının sebebide ayrı bir spana arac girmesin diye attıgım sc


Linki görebilmek için Kayıt olun yada Giriş yapın.


Kod: lua
addEventHandler ("onResourceStart", getRootElement(), 
function()
  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 ("", hitElement, 255, 0, 0, false)
    toggleControl (hitElement, "fire", false)
    toggleControl (hitElement, "next_weapon", false)
    toggleControl (hitElement, "previous_weapon", false)
    toggleControl (hitElement, "sprint", true)
    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 ("", 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())
bu Greenzone calısıyor fakat bende bir script daha var onu ekleyınce yukardaki hatayı verıyor script de baseye aracla gırınce yok edıyor
 


Çevrimdışı Mahlukat

  • Scripter
  • *
    • İleti: 638
Yanıtla #11 : 15 Nisan 2018, 11:29:09
şunu dener misin bir
Kod: lua
addEventHandler ("onResourceStart", getRootElement(), 
function()
  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 hitElement and (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then
    outputChatBox ("", hitElement, 255, 0, 0, false)
    toggleControl (hitElement, "fire", false)
    toggleControl (hitElement, "next_weapon", false)
    toggleControl (hitElement, "previous_weapon", false)
    toggleControl (hitElement, "sprint", true)
    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 leaveElement and(getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then
    outputChatBox ("", 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)
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
Yanıtla #12 : 15 Nisan 2018, 12:27:22
Linki görebilmek için Kayıt olun yada Giriş yapın. suan god gelıyor fakat basede arac cıkarınca warnıng verıyor


Linki görebilmek için Kayıt olun yada Giriş yapın.


warning sebebi bu kod
Kod: lua
-- storage for the zones
-- Format is: {x = 0, y = 0, z = 0, width = 0, depth = 0, height = 0},
local vZones = {
{x = -799.087, y = 9344.534, z = 75, width = 70, depth = 20, height = 10}, -- random example location located in Bone County
}

-- initialize all zones on resource start
local z = {}
function initvZones()
if vZones and #vZones ~= 0 then
for _,v in ipairs (vZones) do
if v then
if v.x and v.y and v.z and v.width and v.depth and v.height then
local c = createColCuboid (v.x, v.y, v.z, v.width, v.depth, v.height)
if c then
z[c] = true
for _,v in ipairs (getElementsByType("vehicle")) do
if isElementWithinColShape (v, c) then
destroyElement(v)
end
end
addEventHandler ("onElementDestroy", c,
function()
if z[source] then
z[source] = nil
end
end
)
addEventHandler ("onColShapeHit", c,
function (h, d)
if h and d and isElement(h) and getElementType (h) == "vehicle" then
destroyElement (h)
end
end
)
end
end
end
end
end
end
addEventHandler ("onResourceStart", resourceRoot, initvZones)

-- The script works fine by itself, but if later any issues occur with removing vehicles, enabling this part may resolve them:
--[[
function destroyVehiclesInvZone()
if isElement(source) and getElementType (source) == "vehicle" then
setTimer(function(source)
if z then
for zone,v in pairs(z) do
if zone and isElement(zone) then
if isElement(source) and isElementWithinColShape(source, zone) then
destroyElement (source)
end
end
end
end
end, 350, 1, source)
end
end
addEventHandler ("onElementStartSync", root, destroyVehiclesInvZone)--]]
 


Çevrimdışı Mahlukat

  • Scripter
  • *
    • İleti: 638
Yanıtla #13 : 15 Nisan 2018, 13:17:12
greenzone.lua
Kod: lua
addEventHandler ("onResourceStart", getRootElement(), 
function()
  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 hitElement and (getElementType (hitElement) == "player") and (getElementID (source) == "greenzoneColshape") then
toggleControl (hitElement, "fire", false)
toggleControl (hitElement, "next_weapon", false)
toggleControl (hitElement, "previous_weapon", false)
toggleControl (hitElement, "sprint", true)
toggleControl (hitElement, "aim_weapon", false)
toggleControl (hitElement, "vehicle_fire", false)
showPlayerHudComponent (hitElement, "ammo", false)
showPlayerHudComponent (hitElement, "weapon", false)
setElementData(hitElement, "Greenzone", true)
elseif hitElement and (getElementType (hitElement) == "vehicle") and (getElementID (source) == "greenzoneColshape") then
destroyElement(hitElement)
end
end)
 
addEventHandler ("onColShapeLeave", getRootElement(),
function(leaveElement, matchingDimension)
if leaveElement and(getElementType (leaveElement) == "player") and (getElementID (source) == "greenzoneColshape") then
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)
setElementData(leaveElement, "Greenzone", nil)
end
end)
greenzoneC.lua
Kod: lua
function onPSKill(target)
if getElementData (target, "Greenzone") then
cancelEvent()
end
end
addEventHandler ("onClientPlayerStealthKill", localPlayer, onPSKill)

addEventHandler ("onClientPlayerDamage", root,function(saldiran)
if saldiran and getElementType(saldiran) == "player" then
if getElementData(localPlayer, "Greenzone")  then
cancelEvent()
end

if getElementData(saldiran, "Greenzone") then
cancelEvent()
end
end
end)

Araç kaybetmeyi de bunun içine koydum diğer scripti durdurup dener misin ?
Linki görebilmek için Kayıt olun yada Giriş yapın.
 


Çevrimdışı cakı11

  • Yeni Üye
  • *
    • İleti: 79
Yanıtla #14 : 15 Nisan 2018, 13:25:53
yardımda bulunan üsenmeden servere gelip bızzat kendi halledigi icin sonuz teşekkürlerimi sunuyorum Linki görebilmek için Kayıt olun yada Giriş yapın. konuyu kitleye bilirsiniz
« Son Düzenleme: 15 Nisan 2018, 19:30:45 Gönderen: cakı11 »