Skip to content

Commit

Permalink
Fixes to safezone
Browse files Browse the repository at this point in the history
- Fixes #30
- #15
  • Loading branch information
Cephel committed Apr 7, 2015
1 parent 5d39d05 commit 793e83d
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
#include "daytime-param\module.hpp"
#include "jip-time-limit\module.hpp"
#include "jip-time-limit-param\module.hpp"
#include "safe-zone\module.hpp"
#include "safezone\module.hpp"
#include "title-card\module.hpp"
File renamed without changes.
2 changes: 1 addition & 1 deletion safe-zone/cfgFunctions.hpp → safezone/cfgFunctions.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Safezone {
class Functions {
file = "modules\safe-zone\functions";
file = "modules\safezone\functions";
class AssignEvent {
postInit = 1;
};
Expand Down
6 changes: 6 additions & 0 deletions safezone/cfgNotifications.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class Safezone {
title = "%1";
iconPicture = "\a3\Ui_F_Curator\Data\CfgMarkers\kia_ca.paa";
description = "%2";
color[] = {"(profilenamespace getvariable ['IGUI_WARNING_RGB_R',0.8])","(profilenamespace getvariable ['IGUI_WARNING_RGB_G',0.5])","(profilenamespace getvariable ['IGUI_WARNING_RGB_B',0.0])","(profilenamespace getvariable ['IGUI_WARNING_RGB_A',0.8])"};
};
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ _deleted = false;
{
// Check if projectile is inside safe zone
if( _projectile distance getMarkerPos _x < ( getMarkerSize _x ) select 0) then {
hint "You can not use weapons inside protection zones!";
["Safezone", ["Safezone", "You can not use weapons inside a safe zone!"]] call bis_fnc_showNotification;
deleteVehicle _projectile;
_deleted = true;
};

// Check if projectile will be inside safe zone next frame
if( !_deleted ) then {
if(( position _projectile vectorAdd ( velocity _projectile vectorMultiply 0.02 )) distance getMarkerPos _x < ( getMarkerSize _x ) select 0 ) then {
hint "You can not fire weapons into a safezone!";
["Safezone", ["Safezone", "You can not fire weapons into a safe zone!"]] call bis_fnc_showNotification;
deleteVehicle _projectile;
_deleted = true;
};
Expand All @@ -33,7 +33,7 @@ if( !_deleted ) then {
waitUntil {
{
if(( position _projectile vectorAdd ( velocity _projectile vectorMultiply 0.02 )) distance getMarkerPos _x < ( getMarkerSize _x ) select 0 ) then {
hint "You can not fire weapons into a safezone!";
["Safezone", ["Safezone", "You can not fire weapons into a safe zone!"]] call bis_fnc_showNotification;
deleteVehicle _projectile;
_deleted = true;
};
Expand Down
6 changes: 5 additions & 1 deletion safe-zone/module.hpp → safezone/module.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifdef A3GFramework_state_Module
class SafeZone {
class Safezone {
name = "Safe Zone";
description = "Provides access to a powerful safezone system.";
authors[] = {"Cephei"};
Expand All @@ -9,3 +9,7 @@
#ifdef A3GFramework_state_Functions
#include "cfgFunctions.hpp"
#endif

#ifdef A3GFramework_state_Notifications
#include "cfgNotifications.hpp"
#endif

0 comments on commit 793e83d

Please sign in to comment.