Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#define FILTERSCRIPT
- #include <a_samp>
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Moving Gate by Spongegar");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- new nb;
- new sb;
- main()
- {
- }
- #endif
- //NorthBound Closing Blocker
- forward close();
- public close ()//close for North Bound Gate
- {
- MoveObject(nb, 1839.9758300,-3562.6206100,24.8720000,4); //after 4 seconds of opened gate it will now closed and will return to it's original position. Closed Position.
- return 1;
- }
- //Southbound Closing Blocker
- forward close2();
- public close2 ()
- {
- MoveObject(sb, 1852.3601100,-3552.4511700,24.8720000,4);//after 4 seconds of opened gate it will now closed and will return to it's original position. Closed Position.
- return 1;
- }
- public OnGameModeInit()
- {
- nb = CreateObject(3578,1839.9758300,-3562.6206100,24.8720000,0.0000000,0.0000000,90.0000000); // North Bound Closed Blocker/Original Position
- sb = CreateObject(3578,1852.3601100,-3552.4511700,24.8720000,0.0000000,0.0000000,90.0000000); // South Bound Closed Blocker /Original Position
- return 1;
- }
- public OnPlayerUpdate(playerid)//placed here so every millisecond the script will detect player's movement
- {
- if(IsPlayerInRangeOfPoint(playerid, 5, 1839.9758300,-3562.6206100,24.8720000)) //Range/area same with the Gate
- {
- MoveObject(nb, 1839.9956, -3562.6233, 23.4365,3); // if the player is in range/area this line will move the gate's Z position in other words the gates will lower in order to open. This is now the OPEN Position of gate
- SetTimer("close", 4000, 0);//Timer before closing (4,000 milliseconds = 4 seconds) and will call the close function
- }
- if(IsPlayerInRangeOfPoint(playerid, 5, 1852.3601,-3552.4512,24.8720000))//Range/area same with the Gate
- {
- MoveObject(sb, 1852.3601, -3552.4512, 23.3609, 3);// if the player is in range/area this line will move the gate's Z position in other words the gates will lower in order to open. This is now the OPEN Position of gate
- SetTimer("close2", 4000, 0);//Timer before closing (4,000 milliseconds = 4 seconds) and will call the close2 function
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment