View Single Post
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen.
Old 04-07-2014 , 17:56   [TF2] Sniper laser
Reply With Quote #1

>>> WATCH OUT; USE BETTER VERSION OF PLUGIN HERE : https://forums.alliedmods.net/showthread.php?t=285428 <<<


Description :
This is just for fun, this plugin will draw a laser from the sniper of the player to where he is looking at.
YAY! Easy target for spys !
Original request : https://forums.alliedmods.net/showthread.php?t=236976

Screenshots & Videos :



clickon image for 1920x1080 resolution.
If someone wanna do a video about this plugin, you can send me the link and I will post it here.
The color of laser can be customized, via sm_lasercolor.

Cvar & installation

Cvar :

sm_tf2sniperlaser_enable "1" //Default 1

Set to "0" to disable the plugin. But would you really do that ?

sm_tf2sniperlaser_default_status "0" //Default 0

Should laser be enabled on each player ? 1=yes 0=no
WARNING : This will be effective on ALL players. Even if they don't have acess to sm_sniperlaser !

sm_tf2sniperlaser_mount_sound "DEFAULT" //Default "DEFAULT"

What should be the sound to play when a player mount a laser on his sniper ? Leave 'DEFAULT' to use the default plugin sound.

sm_tf2sniperlaser_unmount_sound "DEFAULT" //Default "DEFAULT"

What should be the sound to play when a player unmount a laser on his sniper ? Leave 'DEFAULT' to use the default plugin sound.

sm_tf2sniperlaser_view_laser_flag "" //Defauflt ""

All user who have access to this flag will be able to see lasers.

A configuration file (tf2_sniperlaser.cfg) is auto created in in your cfg/sourcemod folder.

Commands :

sm_sniperlaser - Enable/Disable laser on your self. Default flag is cheat OR you can use +reload (your reload key, R by default) key to moun / unmount your laser.

sm_lasercolor - Customize your laser ! You can create your own laser color by using a simple menu ! Default flag is cheat.

sm_reloadlaser - Reload the config file of preset laser color. Do it after eahc changes in tf2_sniperlaser_color.txt.

Installation :

1) Put sniper_laser.smx in your plugins folder.
2) Put tf2_sniperlaser_color.txt in your configs folder if you want create custom preset laser color.
3) Install Updater.
4) Drink some tea ! It's healthy !
5) Reload plugins folder, restart map or restart server.
6) You are done!

For those who wanna compille the plugin manually, you will need :
  • SDKtools
  • SDKhooks
  • MoreColors

Configuration

Oh damn... I don't want to spend 3 houres to config this plugin !

Well, don't be scared, this will take only 1 minute ! And if you really don't want to configure it, well you can. The plugin can run fine without this file.

So, this is how we configure the preset lasers colors :

R-G-B-A

R = Red, this is the ammount of red in the laser. min. 0 | max. 255
G = Green, this is the ammount of green in the laser. min. 0 | max. 255
B = Blue, this is the ammount of blue in the laser. min. 0 | max. 255
A = Alpha, this is the ammount of opacity. 0 -> transparent | 255 -> compact

So, each line is 1 new color :



Save and reload the config file using sm_reloadlaser, and you are done !

Bugs :


Any ! Yay everything is fully working !

Request :

  • Optmize laser beam (less 'lag').
  • Color selections, add a configuration file or/and via chat, let the player specifie the value.

Thanks to :

Oshizu, friagram, Mitchell and Horsedick !

Logs :
------
1.0 : First public release. (SMX download : 18; SP download : 17)
1.1 : Added Updater support. WARNING It's higly recommend to update to 1.1, you will get the next new important updates. (SMX download : 1; SP download : 0)
1.2 : Now, you can moun/unmount your laser simply by pushing +reload key.Also playing 2 different sounds as well.(SMX download : 2; SP download : 1)
1.3 : In 1.2, "sniper_bolt_forward.wav" wasn't played, now it's fixed. (SMX download : 6; SP download : 6)
1.4 : Fixed a lot of bugs and added 2 Cvar to customize the sounds ! (SMX download : 4; SP download : 5)
1.5 : You can now create your own custom preset laser using tf2_sniperlaser_color.txt ! (SMX download : 2; SP download : 2)
1.6 : Fixed a small bug when reading the file with preset color laser. (SMX download : 14; SP download : 14)
1.7 : Added a new Cvar to allow user with this flag to see the lasers. (SMX download : 168; SP download : 83)
1.8 : Apply Leonardo's changes, wich fix everything !
-------

Total SMX download : 182
Total SP download : 128

IMPORTANT NOTE:
Nothing.
Attached Files
File Type: smx sniper_laser.smx (20.3 KB, 929 views)
File Type: sp Get Plugin or Get Source (sniper_laser.sp - 554 views - 16.4 KB)
File Type: txt tf2_sniperlaser_color.txt (15 Bytes, 1120 views)
__________________
Want to check my plugins ?

Last edited by Arkarr; 03-08-2018 at 18:02.
Arkarr is offline