AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D1 & L4D2] Spot Marker [v1.0.7 | 10-October-2021] (https://forums.alliedmods.net/showthread.php?t=331347)

Marttt 03-16-2021 09:42

[L4D1 & L4D2] Spot Marker [v1.0.7 | 10-October-2021]
 
50 Attachment(s)
Description

Based on my [L4D1 & L4D2] SI Command Chase Common plugin.

This plugin allows clients to create spot markers in the map at crosshair while pressing SHIFT+E.

The spot marker will be visible only for teammates.

Features
  • Allow configuring which teams should be able to create spot markers.
  • Allow configuring the duration and cooldown of the ability.
  • Allow configuring who should see the beacon and sprite indicators.
  • Allow configuring the model/color of the indicators.

Preview

https://i.imgur.com/M0cJc5C.jpg

Cvars

A configuration file named "l4d_spot_marker.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder.

PHP Code:

// Allow the command to be used only by alive players.
// 0 = OFF, 1 = ON.
// -
// Default: "1.0"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_spot_marker_alive "1"

// Cooldown (seconds) to use the spot marker.
// -
// Default: "10.0"
// Minimum: "0.000000"
l4d_spot_marker_cooldown "10.0"

// Duration (seconds) of the spot marker.
// -
// Default: "10.0"
// Minimum: "0.000000"
l4d_spot_marker_duration "10.0"

// Enable/Disable the plugin.
// 0 = Disable, 1 = Enable.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_spot_marker_enable "1"

// Create a beacon field.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_spot_marker_field "1"

// Beacon field alpha transparency.
// 0 = Invisible, 255 = Fully Visible.
// -
// Default: "255"
// Minimum: "0.000000"
// Maximum: "255.000000"
l4d_spot_marker_field_alpha "255"

// Beacon field amplitude.
// -
// Default: "0.0"
// Minimum: "0.000000"
l4d_spot_marker_field_amplitude "0.0"

// Beacon field color.
// Use "random" for random colors.
// Use three values between 0-255 separated by spaces ("<0-255> <0-255> <0-255>").
// -
// Default: "255 255 0"
l4d_spot_marker_field_color "255 255 0"

// Beacon field duration (seconds).
// -
// Default: "1.0"
// Minimum: "0.100000"
l4d_spot_marker_field_duration "1.0"

// Beacon field end radius.
// -
// Default: "100.0"
// Minimum: "0.000000"
l4d_spot_marker_field_end_radius "100.0"

// Beacon field model.
// -
// Default: "sprites/laserbeam.vmt"
l4d_spot_marker_field_model "sprites/laserbeam.vmt"

// Beacon field offset (Z pos).
// -
// Default: "24.0"
// Minimum: "0.000000"
l4d_spot_marker_field_offset "24.0"

// Repeat interval to create a beacon field.
// -
// Default: "1.0"
// Minimum: "0.000000"
l4d_spot_marker_field_repeat "1.0"

// Beacon field start radius.
// -
// Default: "75.0"
// Minimum: "0.000000"
l4d_spot_marker_field_start_radius "75.0"

// Beacon field width.
// -
// Default: "2.0"
// Minimum: "0.000000"
l4d_spot_marker_field_width "2.0"

// Show intro message in chat this many seconds after a client joins.
// 0 = OFF.
// -
// Default: "60.0"
// Minimum: "0.000000"
l4d_spot_marker_intro "60.0"

// Display type for the "Intro" message.
// 0 = OFF, 1 = CHAT, 2 = HINT.
// Add numbers greater than 0 for multiple options.
// Example: "3", displays the message in CHAT and as a HINT.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d_spot_marker_intro_msg "1"

// Display type for the "Skill Ready" message.
// 0 = OFF, 1 = CHAT, 2 = HINT.
// Add numbers greater than 0 for multiple options.
// Example: "3", displays the message in CHAT and as a HINT.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d_spot_marker_skill_ready_msg "1"

// Skill ready sound.
// Empty = OFF.
// -
// Default: "ui/alert_clink.wav"
l4d_spot_marker_skill_ready_sound "ui/alert_clink.wav"

// Display type for the "Spot Marked" message.
// 0 = OFF, 1 = CHAT, 2 = HINT.
// Add numbers greater than 0 for multiple options.
// Example: "3", displays the message in CHAT and as a HINT.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d_spot_marker_spot_marked_msg "1"

// Create a sprite.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_spot_marker_sprite "1"

// Sprite alpha transparency.
// Note: Some models don't allow to change the alpha.
// 0 = Invisible, 255 = Fully Visible
// -
// Default: "255"
// Minimum: "0.000000"
// Maximum: "255.000000"
l4d_spot_marker_sprite_alpha "255"

// Sprite color.
// Use "random" for random colors.
// Use three values between 0-255 separated by spaces ("<0-255> <0-255> <0-255>").
// -
// Default: "255 255 0"
l4d_spot_marker_sprite_color "255 255 0"

// Minimum distance that a client must be before the sprite fades.
// -1 = Always visible.
// -
// Default: "-1"
// Minimum: "-1.000000"
// Maximum: "9999.000000"
l4d_spot_marker_sprite_fade_distance "-1"

// Minimum/Maximum distance between the original position that the sprite should reach before inverting the vertical direction.
// 0 = OFF.
// -
// Default: "4.0"
// Minimum: "0.000000"
l4d_spot_marker_sprite_min_max "4.0"

// Sprite model.
// -
// Default: "vgui/icon_download.vmt"
l4d_spot_marker_sprite_model "vgui/icon_download.vmt"

// Sprite scale (increases both height and width).
// Some range values maintain the size the same.
// -
// Default: "0.25"
// Minimum: "0.000000"
l4d_spot_marker_sprite_scale "0.25"

// Speed that the sprite will move at the Z axis.
// 0 = OFF.
// -
// Default: "1.0"
// Minimum: "0.000000"
l4d_spot_marker_sprite_speed "1.0"

// Additional Z axis to the sprite.
// -
// Default: "50.0"
// Minimum: "0.000000"
l4d_spot_marker_sprite_z_axis "50.0"

// Apply the same random color for both field and sprite.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d_spot_marker_sync_random_color "1"

// Which teams should be able to create spot markers.
// 0 = NONE, 1 = SURVIVOR, 2 = INFECTED, 4 = SPECTATOR, 8 = HOLDOUT.
// Add numbers greater than 0 for multiple options.
// Example: "3", enables for SURVIVOR and INFECTED.
// -
// Default: "3"
// Minimum: "0.000000"
// Maximum: "15.000000"
l4d_spot_marker_team "3"

// Use sound.
// Empty = OFF.
// -
// Default: "buttons/blip1.wav"
l4d_spot_marker_use_sound "buttons/blip1.wav" 

Admin Commands
  • sm_spotmarker => Create a spot marker on self crosshair (no args) or specified targets crosshair. Example: self -> sm_spotmarker / target -> sm_spotmarker @bots. (z flag required)
  • sm_print_cvars_l4d_spot_marker => Print the plugin related cvars and their respective values to the console. (z flag required)

Change Log

Spoiler


To Do
  • Add option to player select their own spot marker colors.

Current Translations
  • en - English
  • es - Spanish
  • hu - Hungarian
  • pt - Brazilian Portuguese
  • pt_p - Portuguese
  • ro - Romanian
  • chi - Simplified Chinese
  • zho - Traditional Chinese

Notes
  • The default plugin sprite is visible through walls, this is because of an attribute on the original .vmt file ($ignorez 1).

    If this bothers you, try setting the following cvar to one of these materials:
    PHP Code:

    l4d_spot_marker_sprite_model "vgui/hud/icon_locator_generic.vmt" 

    PHP Code:

    //can't recolor, default color: white
    l4d_spot_marker_sprite_model "vgui/resource/downarrow.vmt" 


Thank you!

Related Plugins

Post Reply
  • Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.

Installation
  • Put the "l4d_spot_marker.phrases.txt" file in your "\addons\sourcemod\translations\" folder.
  • Put the "l4d_spot_marker.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.

PEK727 03-17-2021 14:46

Re: [L4D1 & L4D2] Spot Marker [v1.0.0 | 16-March-2021]
 
Yet another thing I've wanted in L4D2, it works like a charm!

Dragokas 03-18-2021 07:02

Re: [L4D1 & L4D2] Spot Marker [v1.0.0 | 16-March-2021]
 
Cool! Nice feature!

Benjamin38 03-19-2021 22:29

Re: [L4D1 & L4D2] Spot Marker [v1.0.0 | 16-March-2021]
 
Will it be possible to make a sound or a notification appear each time it is used?

Sorry my english D:

moschinovac 03-24-2021 22:46

Re: [L4D1 & L4D2] Spot Marker [v1.0.0 | 16-March-2021]
 
Sometime the arrow can see throught the wall make this is too OP in Realism. Anyway, good plugins.

Proaxel 03-25-2021 04:14

Re: [L4D1 & L4D2] Spot Marker [v1.0.0 | 16-March-2021]
 
I've always thought that one of the main things in L4D2 that does not hold up well today is its lack of a ping system for weapons and items. While this plugin isn't quite there yet it definitely is a start! Here's to hoping this can be built up further into a real ping system that certain other recent team based games have.

I thought getting it to work with other entities would be as simple as adding this part into the code:
PHP Code:

    if (IsValidClientIndex(clientAim))
    {
        
hit true;
        
GetClientAbsOrigin(clientAimvEndPos);
        
PrintToChatAll("%N pinged \x03%N"clientclientAim);
    }
    else if((
IsValidEntity(clientAim)))
    {
        
hit true;
        
GetEntPropVector(clientAimProp_Send"m_vecOrigin"vEndPos0);
        
char entityName[100];
        
GetEdictClassname(clientAimentityNamesizeof(entityName));
        
PrintToChatAll("%N pinged \x03%s"cliententityName);
    } 

Unfortunately this wasn't the case, I tried it on weapon and item spawns in a safe room as well as items dropped on the ground, and while the marker appears as normal the chat message did not. Hopefully the proper solution to this isn't too complex...

Benjamin38 03-25-2021 19:54

Re: [L4D1 & L4D2] Spot Marker [v1.0.0 | 16-March-2021]
 
2 Attachment(s)
I am learning.
add sound and notification.

Shao 03-29-2021 07:02

Re: [L4D1 & L4D2] Spot Marker [v1.0.0 | 16-March-2021]
 
Getting this when in versus.

L 03/29/2021 - 03:58:00: [SM] Exception reported: Client index 962 is invalid
L 03/29/2021 - 03:58:00: [SM] Blaming: l4d_spot_marker.smx
L 03/29/2021 - 03:58:00: [SM] Call stack trace:
L 03/29/2021 - 03:58:00: [SM] [0] IsFakeClient
L 03/29/2021 - 03:58:00: [SM] [1] Line 360, /home/forums/content/files/2/9/0/3/2/7/188332.attach::OnPlayerRunCmdPost

Marttt 04-03-2021 17:22

Re: [L4D1 & L4D2] Spot Marker [v1.0.1 | 03-April-2021]
 
Shao, I wasn't able to reproduce your issue at my end, I even searched in the forum and haven't found any similar case (found only this post here), maybe some plugin is messing with your OnPlayerRunCmd.

Btw, I added a client index check now on OnPlayerRunCmdPost.

--------------------------------------------------

moschinovac,

Related to the sprite being visible through walls, try to do the following steps (added as a Note to the main thread).
  • The default plugin sprite is visible through walls, this is because of an attribute on the original .vmt file ($ignorez 1).

    If this bothers you, try setting the following cvar to one of these materials:
    PHP Code:

    l4d_spot_marker_sprite_model "materials/vgui/hud/icon_locator_generic.vmt" 

    PHP Code:

    //can't recolor, default color: white
    l4d_spot_marker_sprite_model "materials/vgui/resource/downarrow.vmt" 


Psyk0tik 04-03-2021 19:09

Re: [L4D1 & L4D2] Spot Marker [v1.0.1 | 03-April-2021]
 
Quote:

Originally Posted by Marttt (Post 2742897)
Shao, I wasn't able to reproduce your issue at my end, I even searched in the forum and haven't found any similar case (found only this post here), maybe some plugin is messing with your OnPlayerRunCmd.

If this error keeps throwing in your server, PM me so I will add a client index check on the plugin.

I would still add a client index check just in case. Errors like that tend to happen since the forward can fire even for invalid clients, and sometimes they can be caused by other plugins not validating their own clients in their own usage of the forward.

Issues like this also occur for sound hooks which I've run into a lot.

If anyone still gets those invalid index errors even with the index checks added, then the problem lies elsewhere.


All times are GMT -4. The time now is 15:54.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.