0 Üye ve 2 Ziyaretçi konuyu incelemekte.
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 endend)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) endend)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) endend)
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 endend) 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) endend)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) endend)
addEvent("god",true)addEventHandler("god",root,function(god) if god then removeEventHandler("onClientPlayerDamage",root,hasarIptal) addEventHandler("onClientPlayerDamage",root,hasarIptal) else removeEventHandler("onClientPlayerDamage",root,hasarIptal) endend)function hasarIptal() cancelEvent()end
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 endend)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 endend)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) endend)--money zone colmoneyZoneCol = createColCuboid (1993.12, 1519.14, -100, 17.43, 54.24, 117)--stop moneyzone colfunction moneyZoneTimerFunction () local allPlayersInCol = getElementsWithinColShape (moneyZoneCol, "player") for i,v in ipairs (allPlayersInCol) do givePlayerMoney (v, 5) endend-- marker bij hospitalcreateMarker (1607.36, 1814.24, -10, "cylinder", 24, 0, 255, 0, 190, getRootElement())
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 endend) 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) endend) 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) endend)
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 piratenschippirShipMusicCol = 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) endend)addEventHandler ("onClientColShapeLeave", getRootElement(), function(leaveElement, matchingDimension) if (source == pirShipMusicCol) and (leaveElement == getLocalPlayer()) then setRadioChannel (0) endend)
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 piratenschippirShipMusicCol = 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) endend)addEventHandler ("onClientColShapeLeave", getRootElement(), function(leaveElement, matchingDimension) if (source == pirShipMusicCol) and (leaveElement == getLocalPlayer()) then setRadioChannel (0) endend)
serverde hersey kapalı ama yesıl alan geliyor ama god devreye girmiyor Mesaj Birleştirildi: 14 Nisan 2018, 23:00:47normalde 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: luaaddEventHandler ("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 endend)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 endend)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) endend)--money zone colmoneyZoneCol = createColCuboid (1993.12, 1519.14, -100, 17.43, 54.24, 117)--stop moneyzone colfunction moneyZoneTimerFunction () local allPlayersInCol = getElementsWithinColShape (moneyZoneCol, "player") for i,v in ipairs (allPlayersInCol) do givePlayerMoney (v, 5) endend-- marker bij hospitalcreateMarker (1607.36, 1814.24, -10, "cylinder", 24, 0, 255, 0, 190, getRootElement())
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 endend) 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 endend) 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) endend)
-- 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 startlocal 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 endendaddEventHandler ("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) endendaddEventHandler ("onElementStartSync", root, destroyVehiclesInvZone)--]]
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 endend) 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) endend) 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) endend)
function onPSKill(target) if getElementData (target, "Greenzone") then cancelEvent() endendaddEventHandler ("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)