Notorious^ Posted November 6, 2018 Share Posted November 6, 2018 hello This is my anti zombie zone codes.but problem zombies still spawning and 2 or 3 seconds later dying in zone.sometimes they dont die in this zone.so ı added destroyElement but still they spawning. whats my mistake ? Can you please help ? Quote alanlar = { { 1082.17944, -2117.68848, 45.22021, 275.57470703125, 143.94189453125, 47.723364257812}, { 96.42160, 1799.00146, 8.64063, 207.82876586914, 164.90344238281, 49.681719207764}, {1159.22192, -1861.63623, 2207.91968, 458.67749023438, 135.39514160156, 347.82529296875}, {-3028.51025, 412.85077, -4.36548, 165.30834960938, 101.53894042969, 71.609956288338}, } for i,v in pairs(alanlar) do local x, y, z, width, height, depth = unpack(alanlar[i]) --rad = createRadarArea ( x, y, width, height, 255, 0, 0, 170, root ) col = createColCuboid ( x, y, z, width, height, depth) setElementData(col, "zombieProof", true) addEventHandler("onColShapeHit", col, function(giren) if getElementType(giren) == "ped" then if getElementData(giren, "zombie") then destroyElement(giren) end end end) end Link to comment
Z4Zy Posted November 6, 2018 Share Posted November 6, 2018 What about this ? alanlar = { { 1082.17944, -2117.68848, 45.22021, 275.57470703125, 143.94189453125, 47.723364257812}, { 96.42160, 1799.00146, 8.64063, 207.82876586914, 164.90344238281, 49.681719207764}, { 1159.22192, -1861.63623, 2207.91968, 458.67749023438, 135.39514160156, 347.82529296875}, { -3028.51025, 412.85077, -4.36548, 165.30834960938, 101.53894042969, 71.609956288338} } for i,v in pairs(alanlar) do local x, y, z, width, height, depth = unpack(alanlar[i]) --rad = createRadarArea ( x, y, width, height, 255, 0, 0, 170, root ) col = createColCuboid ( x, y, z, width, height, depth) setElementData(col, "zombieProof", true) end addEventHandler("onColShapeHit", root, function(giren) if getElementData(source,"zombieProof") == true and getElementType(giren) == "ped" then if getElementData(giren, "zombie") then destroyElement(giren) end end end ) Link to comment
Notorious^ Posted November 6, 2018 Author Share Posted November 6, 2018 Thanks DeadthStrock but still same. zombies still spawning and 3 or 4 seconds later destroying.ı make anti zombie zone for nemesis area.but now nemesis attacking zombies and later entering bug :C Link to comment
Z4Zy Posted November 6, 2018 Share Posted November 6, 2018 are there any error show in debug console related to script ? Link to comment
Notorious^ Posted November 6, 2018 Author Share Posted November 6, 2018 No its not giving error or warnings ı dont understand what is mistake :C Link to comment
Z4Zy Posted November 6, 2018 Share Posted November 6, 2018 check weather your zombie script set the element data of zombie ped as, setElementData(--[[element]],"zombie",true) Link to comment
Notorious^ Posted November 6, 2018 Author Share Posted November 6, 2018 setElementData ( zomb, "zombie", true ) this line already exist in resources Link to comment
Z4Zy Posted November 6, 2018 Share Posted November 6, 2018 (edited) okay ! It's debug time alanlar = { { 1082.17944, -2117.68848, 45.22021, 275.57470703125, 143.94189453125, 47.723364257812}, { 96.42160, 1799.00146, 8.64063, 207.82876586914, 164.90344238281, 49.681719207764}, { 1159.22192, -1861.63623, 2207.91968, 458.67749023438, 135.39514160156, 347.82529296875}, { -3028.51025, 412.85077, -4.36548, 165.30834960938, 101.53894042969, 71.609956288338} } for i,v in pairs(alanlar) do local x, y, z, width, height, depth = unpack(alanlar[i]) --rad = createRadarArea ( x, y, width, height, 255, 0, 0, 170, root ) col = createColCuboid ( x, y, z, width, height, depth) setElementData(col, "zombieProof", true) end addEventHandler("onColShapeHit", root, function(giren) if getElementData(source,"zombieProof") == true and getElementType(giren) == "ped" then if getElementData(giren, "zombie") then destroyElement(giren) outputChatBox("element destroyed !",root) else outputChatBox("player / ped that entered the col hasn't data called 'zombie' !",root) end elseif getElementType(giren) ~= "ped" then outputChatBox("You are not a ped ! ( "..getElementType(giren).." )",root) elseif getElementData(source,"zombieProof") ~= true outputChatBox("this col hasn't data called 'zombieProof'",root) else outputChatBox("error !",root,255,0,0) end end ) this is a simple debug code created at the moment :3 tell me what outputs when a zombie hit a col created by above script. Edited November 6, 2018 by DeadthStrock Link to comment
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