Init.
This commit is contained in:
+173
@@ -0,0 +1,173 @@
|
||||
class Zone {
|
||||
|
||||
int id;
|
||||
|
||||
int type;
|
||||
|
||||
vector pos;
|
||||
|
||||
float radius;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
enum ZoneType {
|
||||
|
||||
SAFE,
|
||||
|
||||
PSI,
|
||||
|
||||
RAD,
|
||||
|
||||
BIO
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
ref array<ref Zone> ga_zones = new array<ref Zone>;
|
||||
|
||||
|
||||
|
||||
ref ControllerZones ctrl_zones = new ControllerZones;
|
||||
|
||||
|
||||
|
||||
class ControllerZones {
|
||||
|
||||
void ControllerZones() {
|
||||
|
||||
|
||||
|
||||
int id = 0;//
|
||||
|
||||
vector pos;
|
||||
|
||||
float radius;
|
||||
|
||||
int type = 0;
|
||||
|
||||
// only RAD param ↓↓↓
|
||||
|
||||
id = id + 1; // Територия янтаратя 200 метров RAD
|
||||
|
||||
pos = "2405 0 6541";
|
||||
|
||||
radius = 200.0;
|
||||
|
||||
AddZone(id, pos, radius, ZoneType.RAD);
|
||||
|
||||
|
||||
|
||||
// only PSI param ↓↓↓
|
||||
|
||||
id = id + 1; // Територия янтаратя 200 метров PSI
|
||||
|
||||
pos = "2405 0 6541";
|
||||
|
||||
radius = 200.0;
|
||||
|
||||
AddZone(id, pos, radius, ZoneType.PSI);
|
||||
|
||||
|
||||
|
||||
GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(CheckZones, 5000, true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void ~ControllerZones() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AddZone(int id, vector pos, float radius, int type) {
|
||||
|
||||
ref Zone zone = new ref Zone;
|
||||
|
||||
zone.id = id;
|
||||
|
||||
zone.pos = pos;
|
||||
|
||||
zone.radius = radius;
|
||||
|
||||
zone.type = type;
|
||||
|
||||
|
||||
|
||||
ga_zones.Insert(zone);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool InZone(PlayerBase player, ref Zone zone) {
|
||||
|
||||
vector player_position = player.GetPosition();
|
||||
|
||||
player_position[1] = 0;
|
||||
|
||||
|
||||
|
||||
EntityAI attachment;
|
||||
|
||||
ItemBase item;
|
||||
|
||||
string className;
|
||||
|
||||
float biosafe = 0;
|
||||
|
||||
float psisafe = 0;
|
||||
|
||||
float damage_player;
|
||||
|
||||
float damage_zone = 0;
|
||||
|
||||
float damage_zonePSI = 8.0;
|
||||
|
||||
float rpu = 1.0;
|
||||
|
||||
|
||||
|
||||
if( (vector.Distance(player_position, zone.pos)) < zone.radius && zone.type == ZoneType.RAD) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
attachment = player.FindAttachmentBySlotName("Mask"); // Перечеь защиты от радиации
|
||||
|
||||
if ( attachment && attachment.IsItemBase() )
|
||||
|
||||
{
|
||||
|
||||
item = Class.Cast(attachment);
|
||||
|
||||
className = item.GetType();
|
||||
|
||||
if ( className.Contains("dzrp_GasMask_GP1") )
|
||||
|
||||
{
|
||||
|
||||
biosafe = biosafe + 1.0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
attachment = player.FindAttachmentBySlotName("Body");
|
||||
|
||||
if ( attachment && attachment.IsItemBase() )
|
||||
|
||||
{
|
||||
|
||||
item = Class.Cast(attachment);
|
||||
|
||||
className = item.GetType();
|
||||
|
||||
if ( className.Contains("Top_Admin") )
|
||||
Reference in New Issue
Block a user