Shadox Posted March 13, 2024 Share Posted March 13, 2024 Intento Con solo Colocar la pos pero No me aparece en el radar y el color de la zona lo coloco de diferentes colores Pero no se ve ni tampoco hace efecto Help boys pls -- Zona Anti Zombies -- --[[ Las estas zonas evitan que los zombies le hagan daño a los jugadores. ]] local aSavePlaces = { Rectangle = { -- X, Y, Ancho, Alto -- { 2005.2763671875, -1442.0029296875, 90, 80 }; }; } local aRadarAreaPlaces = { -- x, y ,Ancho, Alto, color: R, G, B, A. -- { 2005.2763671875, -1442.0029296875, 90, 80, 0, 0, 0, 0 }; } 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 ) Link to comment
gustavorn Posted March 23, 2024 Share Posted March 23, 2024 Hola @Shadox, Parece que el problema está en la creación del área de radar. Aquí está la corrección en el código para asegurar que el área de radar se cree correctamente y se muestre en el radar: if bUseRadarArea then for _, a in ipairs( aRadarAreaPlaces ) do local x, y, width, height, r, g, b, a = unpack( a ) pRadarArea = createRadarArea( x, y, width, height, r, g, b, a ) end end Asegúrate de que los valores de x, y, width, height y los colores r, g, b, a estén siendo definidos correctamente en la tabla aRadarAreaPlaces. Esto debería garantizar que el área de radar se cree con las dimensiones y colores correctos y se muestre en el radar según lo esperado.E Espero haber ayudado. 1 Link to comment
Shadox Posted March 23, 2024 Author Share Posted March 23, 2024 Muchas Gracias me Funciono 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