iFoReX Posted April 30, 2012 Share Posted April 30, 2012 como dice en el titulo quiero hacer una zona anti zombies se que se ocupa createRadarArea onZombieSpawn pero como hago para cancelar el evento si esta dentro del area ? Link to comment
Alexs Posted April 30, 2012 Share Posted April 30, 2012 como dice en el titulo quiero hacer una zona anti zombiesse que se ocupa createRadarArea onZombieSpawn pero como hago para cancelar el evento si esta dentro del area ? esto: Client: addEventHandler("onClientPlayerDamage",localPlayer, function( ) if getElementData( localPlayer,"damage" ) == "no" then cancelEvent( ) end end ) Server: local savePlaces = { {249, 1230, 10}, {2785, -2417, 20} } -- more colshapes {-1194.8020019531, -1063.5977783203, 100} local radarAreaPlaces = { {249, 1230, 10,10,0,255,0,255}, {2773, -2430, 30,30,0,255,0,255} } -- more radar areas {-1194.8020019531, -1063.5977783203, 189.25,148.25,0,0,255,255} ----------------------- utilizing ----------------------- local resourceName = getResourceName ( resource ) local useGunsInSavePlace = get(resourceName..".UseGunsInSaveZone") local useRadarArea = get(resourceName..".UseRadarArea") local onSavesPlace , CreateRdarAreas ----------------------- added in Version 1.0.1 Resource ----- local useRunInSaveZone = get(resourceName..".UseRunInSaveZone") local useJumpInSaveZone = get(resourceName..".UseJumpInSaveZone") local useWeaponHudInSaveZone = get(resourceName..".UseWeaponHudInSaveZone") local useAmmoHudInSaveZone = get(resourceName..".UseAmmoHudInSaveZone") ----------------------- added in Version 1.0.4 Resource ----- local useDamageInSaveZone = get(resourceName..".UseDamageInSaveZone") ----------------------- utilizing ----------------------- addEventHandler ( "onResourceStart", resourceRoot, function ( startResource ) for i,w in ipairs( savePlaces ) do onSavesPlace = createColCircle ( w[1], w[2], w[3] ) -- create col shape addEventHandler ( "onColShapeHit", onSavesPlace, function ( hitElement, matchingDimension ) if getElementType(hitElement) == "player" then if not useGunsInSavePlace then toggleControl (hitElement, "fire", true ) toggleControl (hitElement, "aim_weapon", true) toggleControl (hitElement, "vehicle_fire", false) end if not useRunInSaveZone then toggleControl (hitElement, "sprint", true ) end if not useJumpInSaveZone then toggleControl (hitElement, "jump", true ) end if not useWeaponHudInSaveZone then showPlayerHudComponent ( hitElement, "weapon", true ) end if not useAmmoHudInSaveZone then showPlayerHudComponent ( hitElement, "ammo", true ) end if not useDamageInSaveZone then setElementData( hitElement,"damage","no" ) end end if getElementType(hitElement) == "ped" then -- check if the entered ped kill it killPed(hitElement) -- kill ped end end ) addEventHandler ( "onColShapeLeave", onSavesPlace, function ( leaveElement, matchingDimension ) if getElementType(leaveElement) == "player" then if not useGunsInSavePlace then toggleControl (leaveElement, "fire", true ) toggleControl (leaveElement, "aim_weapon", true) toggleControl (leaveElement, "vehicle_fire", true) end if not useRunInSaveZone then toggleControl (leaveElement, "sprint", true ) end if not useJumpInSaveZone then toggleControl (leaveElement, "jump", true ) end if not useWeaponHudInSaveZone then showPlayerHudComponent ( leaveElement, "weapon", true ) end if not useAmmoHudInSaveZone then showPlayerHudComponent ( leaveElement, "ammo", true ) end if not useDamageInSaveZone then setElementData( leaveElement,"damage","yes" ) end end if getElementType(leaveElement) == "ped" then -- check if the entered ped kill it killPed(leaveElement) -- kill ped end end ) if useRadarArea then for i,r in ipairs( radarAreaPlaces ) do CreateRdarAreas = createRadarArea ( r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8] ) end end end end ) Meta.Xml "Volk ( Kenix )" description="Advanced Anti Zombie" version="1.0.4" type="script" /> Esta en la comunidad. Link to comment
iFoReX Posted April 30, 2012 Author Share Posted April 30, 2012 lo se pero yo quiero hacer uno simplecito pero gracias a ese resource ya se con que creando colshapes Link to comment
Alexs Posted April 30, 2012 Share Posted April 30, 2012 lo se pero yo quiero hacer uno simplecito pero gracias a ese resource ya se con que creando colshapes si, pero usalo, es mas facil, y puedes poner si quieres permitir el uso de armas o de saltar y todo eso, tambien puedes usar el coleditor Link to comment
iFoReX Posted April 30, 2012 Author Share Posted April 30, 2012 #OFFTopic que es el coleditor ? Link to comment
Alexs Posted April 30, 2012 Share Posted April 30, 2012 #OFFTopic que es el coleditor ? Un resource de la comunidad que mediante dx draw como interfaz, te sirve para crear Colshapes Link to comment
iFoReX Posted April 30, 2012 Author Share Posted April 30, 2012 Vere que tal funciona *-* EDIT : no lo podre ocupar ya que mi teclado no tiene NUM_2 ni esos NUMs :c Link to comment
Alexs Posted April 30, 2012 Share Posted April 30, 2012 Vere que tal funciona *-*EDIT : no lo podre ocupar ya que mi teclado no tiene NUM_2 ni esos NUMs :c edita los bindkey Link to comment
BorderLine Posted April 30, 2012 Share Posted April 30, 2012 usa la funcion incorporada del script de slothman. la cancelacion del spawn en zonas definidas con un setElementData. y la funcion es zombieProof Link to comment
Alexs Posted April 30, 2012 Share Posted April 30, 2012 usa la funcion incorporada del script de slothman. la cancelacion del spawn en zonas definidascon un setElementData. y la funcion es zombieProof el script es mas simple Link to comment
BorderLine Posted May 1, 2012 Share Posted May 1, 2012 algo mas simple ke esto? safecol = createColCuboid ( -411, 1483, 40, 220, 200, 60 ) safeZoneRadar = createRadarArea ( -411, 1483, 220, 200, 0, 255, 0, 100 ) setElementData (safeZoneRadar, "zombieProof", true) este es un ejemplo de mi zona, cambiale las dimenciones y las cordenadas Link to comment
iFoReX Posted May 1, 2012 Author Share Posted May 1, 2012 ok yakusa solo 1 pregunta... las coordenadas del cuboid son las mismas que la de la zona radar #OFFTopic : ademas.. Yakusa me pase por tu server y los de los clanes estan fuera de la zona anti zombies y pasan matando a las personas comunes y corrientes Link to comment
BorderLine Posted May 1, 2012 Share Posted May 1, 2012 si man, o nomas si kieres aplicas radararea nomas. y en cuanto al off topic, el server es deathmatch. pero ideare godmode para los civiles y que tampoco agan daño, nomas los clanes puedan matarse entre si Link to comment
iFoReX Posted May 1, 2012 Author Share Posted May 1, 2012 Ok man pero no se necesita ejecutar algun getElementData ? Link to comment
iFoReX Posted May 6, 2012 Author Share Posted May 6, 2012 yakusa no me sirvio D: se crea el area en el radar pero los zombis igual entran y matan safecol = createColCuboid ( 661.65600585938, -2784.9812011719, 8.5092506408691, 220, 200, 60 ) safeZoneRadar = createRadarArea ( 661.65600585938, -2784.9812011719, 220, 200, 0, 255, 0, 100 ) setElementData (safeZoneRadar, "zombieProof", true) Link to comment
Soren Posted May 6, 2012 Share Posted May 6, 2012 safecol = createColCuboid ( 661.65600585938, -2784.9812011719, 8.5092506408691, 220, 200, 60 ) safeZoneRadar = createRadarArea ( 661.65600585938, -2784.9812011719, 220, 200, 0, 255, 0, 100 ) setElementData (safecol, "zombieProof", true) Link to comment
BorderLine Posted May 7, 2012 Share Posted May 7, 2012 eso solo cancela el spawn de zombies. los zombies podran entrar igual. agrega esta linea function enterZone( hitElement, matchingDimension) if getElementType(hitElement) == "ped" then killPed(hitElement) end end addEventHandler( "onColShapeHit", safecol, enterZone ) Link to comment
iFoReX Posted May 7, 2012 Author Share Posted May 7, 2012 igual entran y algunos nomas mueren D: Link to comment
BorderLine Posted May 7, 2012 Share Posted May 7, 2012 dale menos Z a la cordenada del safecol. en vez de 8.509... ponele 0 Link to comment
JuakoKIIL Posted June 23, 2012 Share Posted June 23, 2012 disculpen miren soy nuevo en esto digamos un noob pero mis players de mi server kieren tener area anti zombie en las bases de sus clanes entendi todo lo ke dijieron pero no entendi como sacaran las posiciones no se si es Z, X o Y le sagredeceria si me lo aclaran. Link to comment
iFoReX Posted June 23, 2012 Author Share Posted June 23, 2012 Juako lee que argumentos van en las 2 funciones en la wiki Link to comment
BorderLine Posted June 23, 2012 Share Posted June 23, 2012 Para ser mas explicito juako, las cordenadas x,y,z son las de posision del map de san andreas Te explicare safecol = createColCuboid ( 661, -2784, 8, 220, 200, 60 ) Aqui tienes la creacion de la zona antizombie el 661 sera la cordenada X, -2784 cordenada Y, 8 cordenada Z Estas cordenadas seran las del punto de creacion de la zona antizombie Las puedes sakar del panel de administrador. vas al lugar donde quieres la zona antizombie y te paras sobre ese lugar, y pones el panel de admin y te seleccionas entre los jugadores y abajo, salen tus cordenadas, X: xxxxx Y: xxxxx Z: xxxxx No tienes que ser tan especifico al momnento de agregar los decimales, puedes agregar solo el numero entero. Despues de eso, iingresas tus cordenadas (atentos a cuales son negativas y cuales no) safecol = createColCuboid ( X, Y, Z, 220, 200, 60 ) Despues de eso 220, 200 y 60 es el limite de expancion Osea cuanto quieres que se expanda el limite. Obiamente ingresando las cordenadas X,Y,Z nomas se creara el punto inicial, y para que cubra toda la base, o lugar antizombie debes ir subiendole el 220,200 y 60 Debes jugar con los primeros 2, 220 y 200, 60 es la altura. Si no es suficiente zona o demaciado, bajale y asi vas reiniciando el recurso asta ke veas los cambios espero averte ayudado suerte Link to comment
JuakoKIIL Posted June 23, 2012 Share Posted June 23, 2012 y ke hago con el ¿' lo otro lo entendi gracias safeZoneRadar = createRadarArea ( 661.65600585938, -2784.9812011719, 220, 200, 0, 255, 0, 100 ) setElementData (safecol, "zombieProof", true) Link to comment
Alexs Posted June 23, 2012 Share Posted June 23, 2012 zombieProof es para radar-areas no Colshapes: addEvent( "onZombieSpawn", true ) function RanSpawn_Z ( gx, gy, gz, rot) local safezone = 0 local allradars = getElementsByType("radararea") for theKey,theradar in ipairs(allradars) do if getElementData(theradar, "zombieProof") == true then if isInsideRadarArea ( theradar, gx, gy ) then safezone = 1 end end end Link to comment
Recommended Posts