10.03.2009, 21:19
[FS]Remote Controlled Security Camera's [CCTV] [V1.2]
360-degree turnable
[NOTE]: These gif-images here above are just an impression. The real cameras turns much smoother!!
360-degree turnable
[NOTE]: These gif-images here above are just an impression. The real cameras turns much smoother!!
Features:
- 13 premade camera's
- Easy to use and configure
- Easy to add more camera's
- Rotates very smoothly
- Dynamic menu-system
- All Camera's will be put in menu's. Each menu can handle 12 items/camera's. If you have more than 12 camera's, automatically a new menu will be created and on previous page, a "Next"-button will be added.
Easy to control camera's:
- With the command /cctv you can open the menu where all camera's are listed in. Use the up/down-arrowkeys to scroll through the menu and press left-shift to confirm your selection. You will be teleported to the selected Camera.
- Keys to use camera:
- left/right arrowkeys Rotate the camera to the left or right
- up/down arrowkeys Move camera up/down
- sprintkey (l-shift) Speed up
- crouchkey (ctrl) Exit the camera
Easy to add more camera's:
- A camera can be added with only 1 single line: AddCCTV("Name", Float:X, Float:Y, Float:Z, Float:Angle);
- Those coordinates are the coords of the position of the camera. All other coordinates, such as PlayerPosition, CameraLookAt and circle will be calculated automatically.
- The Angle is the number of degrees the camera facing to at the start. (0 = north, 90 = west, 180 = south & 270 is east)
- The name you enter is be the name that will appear in the menu.
- Like said before, new cctv's will be added to the menu automatically. Reloading the filterscript is needed!
Other Notes:
- Disadvantage: Because the player has to be near the camera while @ camera-mode. Else the the objects/landscape will not load.
That was one of the problems i had to face while working on this FS. To solve this problem, i had to position the player on top of the camera (2 coords). You are frozen, so you can not get killed. It just doesn't look very good (a floating player in the air), but this is only solution. Fixed: Player is now Undergrond (Z-coord = -100)
You will be teleported back to your old location when you exit the camera. -
If you have a roleplay-gamemode and you want to make this cctv-feature only available for (for example) cops. You will have to copy/paste this filterscript into your gamemode and make the /cctv commando only available for the cop-team.
for example:
Change:
Код:
if (strcmp("/cctv", cmdtext, true) == 0) { PlayerMenu[playerid] = 0; TogglePlayerControllable(playerid, 0); ShowMenuForPlayer(CCTVMenu[0], playerid); return 1; }
Код:
if (strcmp("/cctv", cmdtext, true) == 0) { if(gTeam[playerid] == TEAM_COPS) { PlayerMenu[playerid] = 0; TogglePlayerControllable(playerid, 0); ShowMenuForPlayer(CCTVMenu[0], playerid); return 1; } }
- Download CCTV.pwn (and CCTV.amx) and put them into your 'filterscripts'-folder
- Open CCTV.pwn and add/remove/edit the camera's @ OnFilterScriptInit() using AddCCTV(....);
- Compile
- Add "CCTV" behind after "filterscripts" in server.cfg
- Start the server
- Use /cctv to open menu and select a camera
- V1.0: First Release
- V1.1: Changed player-position to -100 (underground)
- V2.2:
- /cctv now only available when spawned
- Added Angle-param, to the AddCCTV(..) function.
- Start-rotation changed. Camera now won't look down to the ground when 'entering' the camera.
- Removed some debug-code from OnPlayerCommandText-callback.
- http://www.mediafire.com/file/q2taedcmdcq/CCTV.pwn
- http://www.mediafire.com/file/nyzuntmv3gj/CCTV.amx
- http://pastebin.com/f438ec58e
Bugs:
- None so far
- Please report if you find any!
Enjoy and leave a comment in this topic!