DarkNeSsOak Posted October 3, 2016 Share Posted October 3, 2016 (edited) Ayuda Zona Segura (Safe Zone) El caso es que quiero que cuando salga el boss se active la zona segura para que los player no se hagan daño cuando salga el boss y lo que pasa es que el boss no hace daño cuando esta dentro de dicha zona, esta Zona tambien es para que no entren los Zombies. Junte El safe Zone Con el boss para que cuando salga se active el safe Zone pero nose como hacer que cuando muera el boss se quite el safe Zone Ayuda porfavor http://imgur.com/hbGEZci http://imgur.com/dhTBnZh http://imgur.com/lBFnG8V http://imgur.com/OMt5OxY Server: -- Advanced Anti Zombie by Kenix version 1.0.6 --[[ It's example how use it. Change this ]] local aSavePlaces = { Rectangle = { -- X, Y, Width, Height { 1115.0374755859, -2117.1108398438, 130, 140 }; }; } local aRadarAreaPlaces = { -- x, y ,size 1, size 2, color: red, green, blue, alpha. { 1115.0374755859, -2117.1108398438, 130, 140, 0, 255, 0, 255 }; { 2773, -2430, 30, 30, 0, 255, 0, 255 }; } local sResourceName = getResourceName ( resource ) local bUseGunsInSavePlace = get( sResourceName .. '.UseGunsInSaveZone' ) local bUseRadarArea = get( sResourceName .. '.UseRadarArea' ) local pColshape, pRadarArea local bUseRunInSaveZone = get( sResourceName .. '.UseRunInSaveZone' ) local bUseJumpInSaveZone = get( sResourceName .. '.UseJumpInSaveZone' ) local bUseWeaponHudInSaveZone = get( sResourceName .. '.UseWeaponHudInSaveZone' ) local bUseAmmoHudInSaveZone = get( sResourceName .. '.UseAmmoHudInSaveZone' ) local bUseDamageInSaveZone = get( sResourceName .. '.UseDamageInSaveZone' ) addEventHandler ( 'onResourceStart', resourceRoot, function ( ) for s, _ in pairs( aSavePlaces ) do for _, a in pairs( aSavePlaces[ s ] ) do pColshape = _G[ 'createCol' .. s ]( unpack( a ) ) setElementData( pColshape, 'zombieProof', true ) addEventHandler ( 'onColShapeHit', pColshape, function ( pHitElement ) if getElementType( pHitElement ) == 'player' then if not bUseGunsInSavePlace then toggleControl ( pHitElement, 'fire', false ) toggleControl ( pHitElement, 'aim_weapon', false ) toggleControl ( pHitElement, 'vehicle_fire', false ) end if not bUseRunInSaveZone then toggleControl ( pHitElement, 'sprint', false ) end if not bUseJumpInSaveZone then toggleControl ( pHitElement, 'jump', false ) end if not bUseWeaponHudInSaveZone then showPlayerHudComponent ( pHitElement, 'weapon', false ) end if not bUseAmmoHudInSaveZone then showPlayerHudComponent ( pHitElement, 'ammo', false ) end if not bUseDamageInSaveZone then setElementData( pHitElement, 'damage', 'no' ) end elseif getElementType( pHitElement ) == 'ped' then -- check if the entered ped kill it killPed( pHitElement ) -- kill ped end end ) addEventHandler ( 'onColShapeLeave', pColshape, function ( pLeaveElement ) if getElementType( pLeaveElement ) == 'player' then if not bUseGunsInSavePlace then toggleControl ( pLeaveElement, 'fire', true ) toggleControl ( pLeaveElement, 'aim_weapon', true ) toggleControl ( pLeaveElement, 'vehicle_fire', true ) end if not bUseRunInSaveZone then toggleControl ( pLeaveElement, 'sprint', true ) end if not bUseJumpInSaveZone then toggleControl ( pLeaveElement, 'jump', true ) end if not bUseWeaponHudInSaveZone then showPlayerHudComponent ( pLeaveElement, 'weapon', true ) end if not bUseAmmoHudInSaveZone then showPlayerHudComponent ( pLeaveElement, 'ammo', true ) end if not bUseDamageInSaveZone then setElementData( pLeaveElement, 'damage', 'yes' ) end elseif getElementType( pLeaveElement ) == 'ped' then -- check if the entered ped kill it killPed( pLeaveElement ) -- kill ped end end ) end end if bUseRadarArea then for _, a in ipairs( aRadarAreaPlaces ) do pRadarArea = createRadarArea ( unpack( a ) ) end end end ) _____________________________________________________________________________________________________________ Client: addEventHandler( 'onClientPlayerDamage', localPlayer, function( ) if getElementData( localPlayer, 'damage' ) == 'no' then cancelEvent( ) end end ) __________________________________________________________________________________________________________________ Meta: <meta> <info author="stor" version="1.0" type="script" name="Boomer" description="LauraSad" /> <script src="server.lua" type="server" /> <script src="client.lua" type="client" /> <file src="skin/boomer.txd" /> <file src="skin/boomer.dff" /> <file src="skin/zombi.txd" /> <file src="skin/zombi.dff" /> <file src="sonido1.mp3" /> <file src="sonido2.mp3" /> <file src="boom.wav" /> <include resource="extra_health" /> <include resource="slothbot" /> <script src="core_server.lua" type="server"/> <script src="core_client.lua" type="client"/> <settings> <!-- option 1 --> <setting name="#UseGunsInSaveZone" value="[ true ]" /> <!-- option 2 --> <setting name="#UseRadarArea" value="[ true ]" /> <!-- Added in version 1.0.1 --> <!-- option 3 --> <setting name="#UseRunInSaveZone" value="[ true ]" /> <!-- option 4 --> <setting name="#UseJumpInSaveZone" value="[ true ]" /> <!-- option 5 --> <setting name="#UseWeaponHudInSaveZone" value="[ true ]" /> <!-- option 6 --> <setting name="#UseAmmoHudInSaveZone" value="[ true ]" /> <!-- Added in version 1.0.4 --> <!-- option 7 --> <setting name="#UseDamageInSaveZone" value="[ false ]" /> <!-- option 1 = If a player enters the zone, he can not use a gun --> <!-- option 2 = use this option if you want to use Radar Area (color map) --> <!-- Added in version 1.0.1 --> <!-- option 3 = If you are using false then you can not run in this area and if you use true you will be able to run in this area --> <!-- option 4 = If you are using false then you can not jump in this area and if you use true you will be able to jump in this area --> <!-- option 5 = this option is responsible for the weapon if you use false then when you go into this zone your weapon (HUD) is not visible and if true then the opposite --> <!-- option 6 = this option is responsible for the ammo if you use false when you go in this area and ammo (HUD) is not visible and if true then the opposite --> <!-- Added in version 1.0.4 --> <!-- option 7 = this option is if damage you if use false then canceled damage --> <!-- Notice: all options are on default --> </settings> </meta> Edited October 3, 2016 by DarkNeSsOak Link to comment
Tomas Posted October 4, 2016 Share Posted October 4, 2016 addEventHandler( 'onClientPlayerDamage', localPlayer, function(attacker) if getElementData( localPlayer, 'damage' ) == 'no' and ( attacker and attacker == "player" ) then cancelEvent( ) end end ) Link to comment
DarkNeSsOak Posted October 5, 2016 Author Share Posted October 5, 2016 (edited) Ok lo intentare Edited October 5, 2016 by DarkNeSsOak Link to comment
DarkNeSsOak Posted October 5, 2016 Author Share Posted October 5, 2016 No me Funciono Link to comment
Tomas Posted October 6, 2016 Share Posted October 6, 2016 On 5/10/2016 at 4:56 PM, DarkNeSsOak said: No me Funciono ¿Qué es lo que pasa? Link to comment
DarkNeSsOak Posted October 8, 2016 Author Share Posted October 8, 2016 lo mismo :/.. no hay daño. Link to comment
Tomas Posted October 12, 2016 Share Posted October 12, 2016 addEventHandler( 'onClientPlayerDamage', localPlayer, function(attacker) if getElementData( localPlayer, 'damage' ) == 'no' and ( attacker and getElementType(attacker) == "player" ) then cancelEvent( ) end end ) Me habia comido el getElementType Link to comment
DarkNeSsOak Posted October 17, 2016 Author Share Posted October 17, 2016 No. nada amigo pero gracias igualmente hare otro topic Link to comment
Recommended Posts