Files
dsrc/sku.0/sys.server/compiled/game/script/systems/regions/region_tracker.script
T

68 lines
1.3 KiB
Plaintext

include library.locations;
trigger OnInitialize()
{
debugServerConsoleMsg(self, "setting city name on "+self);
if(!hasObjVar(self, "strCity"))
{
string strCity = locations.getCityName(getLocation(self));
if(strCity!=null)
{
debugServerConsoleMsg(self, "City name is "+strCity);
setObjVar(self, "strCity", strCity);
int intRegionSize = getIntObjVar(self, "intSize");
intRegionSize = intRegionSize/2;
setObjVar(self, "intSize", intRegionSize); // half the regoin size
}
else
{
debugServerConsoleMsg(self, "OBJ_ID "+self+" IS A DELIVER REGION SPAWNER PLACED OUTSIDE OF A CITY. IT SHOULD BE DELETED");
}
}
else
{
string strCity = getStringObjVar(self, "strCity");
LOG("regions", "strCity is "+strCity);
if(strCity==null)
{
strCity = locations.getCityName(getLocation(self));
debugServerConsoleMsg(self, "City name is "+strCity);
setObjVar(self, "strCity", strCity);
}
}
return SCRIPT_CONTINUE;
}
trigger OnAttach()
{
if(!hasObjVar(self, "strCity"))
{
string strCity = locations.getCityName(getLocation(self));
if(strCity!=null)
{
setObjVar(self, "strCity", strCity);
}
else
{
debugServerConsoleMsg(self, "OBJ_ID "+self+" IS A DELIVER REGION SPAWNER PLACED OUTSIDE OF A CITY. IT SHOULD BE DELETED");
}
}
return SCRIPT_CONTINUE;
}