- Switched from "for(new" loops to YSI's "foreach" loops for better performance. - Changed some variables name to eliminate potential duplicates. - Added "moveSpeed" parameter for barriers. - Barriers rotation is now fully custom. You can still use the definitions or put your own rotation value(0-360 degrees). - Added "MOVE_CUSTOM" definition for gates. - Added "movetoX", "movetoY", "movetoZ" parameter for custom 'move-to' position. - Increased max gates from 250 to 1000. - Increased max groups from 50 to 500. - Bug Fixed: Barrier or Gate was stuck if player exited while on gate area. - Bug Fixed: Barrier or Gate was still in group array when destroyed. - Other small bug fixes which are not very relevant to put into this list.
- Changed Timer Trigger to Dynamic Area Trigger(No Radius check). - Deleted "moveTime" parameter. - Deleted "NGatesCheck" function. - All Timers deleted. - Deleted definition "NGATE_UPDATEINTERVAL". - Added mode "MODE_MANUAL_AUTO". - Deleted GatesPoolSize.
- Added Groups. - Added Cascade triggering.
- First Release
NGateCreate(modelID, Float: objectX, Float: objectY, Float: objectZ, Float: objectRotX=0.0, Float: objectRotY=0.0, Float: objectRotZ=0.0, moveDirection = MOVE_DOWN, Float: movetoX = 0.0, Float: movetoY = 0.0, Float: movetoZ = 0.0, moveMode = MODE_ALL_AUTO, Float:moveSpeed = 3.0, Float:moveRadius = 6.0, accessID[]={ -1 }, Float: detectRadius=13.0, detectKey=KEY_CROUCH, CmdToOpen[]="", CmdToClose[]="", Float: cDetectX=0.0, Float: cDetectY=0.0, Float: cDetectZ=0.0, accessIDsize = sizeof accessID) NBarrierCreate(Float: objectX, Float: objectY, Float: objectZ, Float:objectZRot, moveMode = MODE_ALL_AUTO, Float:RotSpeed = 1.0, accessID[]={ -1 }, Float: detectRadius=13.0, detectKey=KEY_CROUCH, CmdToOpen[]="", CmdToClose[]="", Float: cDetectX=0.0, Float: cDetectY=0.0, Float: cDetectZ=0.0, accessIDsize = sizeof accessID) NGateDestroy(gateid); NGateSetAccessID(playerid, id); NGateOpen(gateid); NGateClose(gateid); NGateIsGateOpen(gateid); NGateCreateGroup(); NGateAddToGroup(gateid, groupid); NGateReturnObjectID(gateid);
NGateCreate(MODELID, X, Y, Z, XR, YR, ZR, DIRECTION); or NGateCreate(MODELID, X, Y, Z, XR, YR, ZR, MOVE_CUSTOM, MOVETOX, MOVETOY, MOVETOZ);
NBarrierCreate(X, Y, Z, DIRECTION_ROTATION);
//Gates NGateCreate(969, 1503.50, -2498.4253, 12.7261, 0.0, 0.0, 90.0, MOVE_DOWN); NGateCreate(969, 1533.50, -2498.4253, 12.7261, 0.0, 0.0, 90.0, MOVE_CUSTOM, 0.0, 0.0, 0.0, MODE_VEHICLE_KEYINPUT, 3.0, 8.0); NGateCreate(969, 1563.50, -2498.4253, 12.7261, 0.0, 0.0, 90.0, MOVE_UP, 0.0, 0.0, 0.0, MODE_ALL_COMMANDINPUT, 3.0, 8.0, {-1}, 10.0, -1, "/open"); NGateCreate(969, 1593.50, -2498.4253, 12.7261, 0.0, 0.0, 90.0, MOVE_SOUTH, 0.0, 0.0, 0.0, MODE_WALK_COMMANDINPUT, 3.0, 8.0, {20}, 10.0 , -1, "/open", "/close"); gateid1 = NGateCreate(969, 1623.50, -2498.4253, 12.7261, 0.0, 0.0, 90.0, MOVE_NORD, 0.0, 0.0, 0.0, MODE_MANUAL, 3.0, 8.0); new groupid = NGateCreateGroup(); new tmp_gateid1 = NGateCreate(988, 1653.5431, -2491.3015, 13.5800, 0.0, 0.0, -90.0, MOVE_NORD, 0.0, 0.0, 0.0, MODE_ALL_AUTO, 0.5, 4.0); new tmp_gateid2 = NGateCreate(988, 1653.5431, -2496.7822, 13.5800, 0.0, 0.0, -90.0, MOVE_SOUTH, 0.0, 0.0, 0.0, MODE_ALL_AUTO, 0.5, 4.0); NGateAddToGroup(tmp_gateid1, groupid); NGateAddToGroup(tmp_gateid2, groupid); gateid2 = NGateCreate(980, 1687.8888, -2494.1372, 12.5575, 90.0, 0.0, 0.0, MOVE_UP, 0.0, 0.0, 0.0, MODE_MANUAL, 3.0, 26.0); NGateCreate(980, 1693.6348, -2494.5649, 41.1800, 0.0, 0.0, 90.0, MOVE_NORD, 0.0, 0.0, 0.0, MODE_VEHICLE_AUTO, 1.0, 12.0); //Barriers NBarrierCreate(1759.87183, -2512.34668, 39.30200, 45.0); NBarrierCreate(1759.87183, -2542.34668, 39.30200, BARRIER_ROT_OST, MODE_VEHICLE_COMMANDINPUT, 1.0, {10, 15, 64}, 10.0, -1, "/open"); NBarrierCreate(1759.87183, -2572.34668, 39.30200, BARRIER_ROT_OST, MODE_VEHICLE_KEYINPUT); barierid1 = NBarrierCreate(1759.87183, -2602.34668, 39.30200, BARRIER_ROT_OST, MODE_MANUAL_AUTO, 1.0, {-1}, 10.0);
#define NGATE_MAX_GATES 1000 #define NGATE_MAX_GROUPS 500 #define MOVE_DOWN 0 #define MOVE_UP 1 #define MOVE_NORD 2 #define MOVE_OST 3 #define MOVE_SOUTH 4 #define MOVE_WEST 5 #define MOVE_CUSTOM 6 #define MODE_MANUAL 0 #define MODE_MANUAL_AUTO 1 #define MODE_ALL_AUTO 2 #define MODE_WALK_AUTO 3 #define MODE_VEHICLE_AUTO 4 #define MODE_ALL_KEYINPUT 5 #define MODE_WALK_KEYINPUT 6 #define MODE_VEHICLE_KEYINPUT 7 #define MODE_ALL_COMMANDINPUT 8 #define MODE_WALK_COMMANDINPUT 9 #define MODE_VEHICLE_COMMANDINPUT 10 #define BARRIER_ROT_NORD 90.0 #define BARRIER_ROT_OST 0.0 #define BARRIER_ROT_SOUTH -90.0 #define BARRIER_ROT_WEST 180.0
why do you use timers to open gate? instead of opening them instantly also you could use dynamic areas
|
- Switched from "for(new" loops to YSI's "foreach" loops for better performance. - Changed some variables name to eliminate potential duplicates. - Added "moveSpeed" parameter for barriers. - Barriers rotation is now fully custom. You can still use the definitions or put your own rotation value(0-360 degrees). - Added "MOVE_CUSTOM" definition for gates. - Added "movetoX", "movetoY", "movetoZ" parameter for custom 'move-to' position. - Increased max gates from 250 to 1000. - Increased max groups from 50 to 500. - Bug Fixed: Barrier or Gate was stuck if player exited while on gate area. - Bug Fixed: Barrier or Gate was still in group array when destroyed. - Other small bug fixes which are not very relevant to put into this list.