Merhabalar, Sunucumda headshot sistemi var. Tek sorunum greenzone(güvenli bölge) de oyuncuyu hiç bir türlü hasar veremezsiniz fakat Kafadan vurdugunuz zaman ölüyor. Tamamen headshot sistemi ile alakalıdır. Buna nasıl çözüm bulabiliriz? Yardımcı olabilecek birisi var mı acaba :))
-- Format is: {x = 0, y = 0, z = 0, width = 0, depth = 0, height = 0},local greenzones ={{x =110, y =-2075, z =-40, width =257, depth =333, height =200},-- Giriş Yeri{x =1150, y =-1375, z =-10, width =120, depth =100, height =100}-- Hastane}-- Initialize all zones on resource startlocal z ={}function initGreenzones()if greenzones and#greenzones ~=0thenfor _, v in ipairs(greenzones)doif v thenif v.x and v.y and v.z and v.width and v.depth and v.height thenlocal c = createColCuboid(v.x, v.y, v.z, v.width, v.depth, v.height)local rarea = createRadarArea(v.x, v.y, v.width, v.depth,0,255,0,150)
setElementParent(rarea, c)if c then
z[c]=truefor _, p in ipairs(getElementsWithinColShape(c,"player"))do
setElementData(p,"greenzone",true)endfor _, v in ipairs(getElementsWithinColShape(c,"vehicle"))do
setElementData(v,"greenzoneveh",true)end
addEventHandler("onElementDestroy", c,function()if z[source]then
z[source]=nilendend)
addEventHandler("onColShapeHit", c,function(h)if h and isElement(h)and getElementType(h)=="player"thenif getElementData(h,"colShapeFix_OUT")then
setElementData(h,"colShapeFix_OUT",false)returnend-- Hack to prevent shooting bug: if player teleports from one greenzone directly to another and fails to clean up (on time)if getElementData(h,"greenzone")then
setElementData(h,"colShapeFix_IN",true)
triggerClientEvent(h,"onEnterGreenzone", h)else
setElementData(h,"greenzone",true)
toggleControl(h,"fire",false)
toggleControl(h,"next_weapon",false)
toggleControl(h,"previous_weapon",false)
toggleControl(h,"aim_weapon",false)
toggleControl(h,"vehicle_fire",false)
toggleControl(h,"vehicle_secondary_fire",false)--outputChatBox("[Hawk Yönetimi] Güvenli bölgeye giriş yaptınız.", h, 0, 220, 0)
triggerClientEvent(h,"onEnterGreenzone", h)endendend)
addEventHandler("onColShapeHit", c,function(h)if h and isElement(h)and getElementType(h)=="vehicle"then
setElementData(h,"greenzoneveh",true)endend)
addEventHandler("onColShapeLeave", c,function(h)if h and isElement(h)and getElementType(h)=="player"thenif getElementData(h,"colShapeFix_IN")then
setElementData(h,"colShapeFix_IN",false)returnendif getElementData(h,"greenzone")then
setElementData(h,"greenzone",false)
toggleControl(h,"fire",true)
toggleControl(h,"next_weapon",true)
toggleControl(h,"previous_weapon",true)
toggleControl(h,"aim_weapon",true)
toggleControl(h,"vehicle_fire",true)
toggleControl(h,"vehicle_secondary_fire",true)--outputChatBox("[Hawk Yönetimi] Güvenli bölgeden ayrılıyorsunuz.", h, 220, 220, 0)
triggerClientEvent(h,"onLeaveGreenzone", h)else
setElementData(h,"colShapeFix_OUT",true)endendend)
addEventHandler("onColShapeLeave", c,function(h)if h and isElement(h)and getElementType(h)=="vehicle"then
setTimer(setElementData,350,1, h,"greenzoneveh",false)endend)endendendendendend
addEventHandler("onResourceStart", resourceRoot, initGreenzones)function resetGreenzoneData()for _, p in ipairs(getElementsByType("player"))doif isElement(p)then
removeElementData(p,"greenzone")endendend
addEventHandler("onResourceStop", resourceRoot, resetGreenzoneData)
Question
India
Merhabalar, Sunucumda headshot sistemi var. Tek sorunum greenzone(güvenli bölge) de oyuncuyu hiç bir türlü hasar veremezsiniz fakat Kafadan vurdugunuz zaman ölüyor. Tamamen headshot sistemi ile alakalıdır. Buna nasıl çözüm bulabiliriz? Yardımcı olabilecek birisi var mı acaba :))
headshot_s.Lua
greenzone, server.Lua
Link to comment
1 answer to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now