generated from Jaysyn/ModuleTemplate
Initial commit
Initial commit
This commit is contained in:
26
_module/nss/opw_area_onexit.nss
Normal file
26
_module/nss/opw_area_onexit.nss
Normal file
@@ -0,0 +1,26 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// Client Counting for Areas - On Area Enter
|
||||
// opw_area_onexit
|
||||
// By Don Anderson
|
||||
// dandersonru@msn.com
|
||||
//
|
||||
// Place this in the Area On Enter Event
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetExitingObject();
|
||||
object oMod = GetModule();
|
||||
object oArea = GetArea(oPC);
|
||||
|
||||
//Record that there is Someone who Matters in the Area
|
||||
if(GetIsPC(oPC) || GetIsDM(oPC) || GetIsDMPossessed(oPC))
|
||||
{
|
||||
int nClient = GetLocalInt(oArea,"CLIENTINAREA");
|
||||
nClient--;
|
||||
if(nClient < 0) nClient = 0;
|
||||
if(nClient == 0) ExecuteScript("opw_oax_reset",oArea);
|
||||
SetLocalInt(oArea,"CLIENTINAREA",nClient);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user