View Single Post
Author Message
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 08-23-2010 , 16:14   [L4D & L4D2] Achievement Trophy (2.7) [11-Dec-2022]
Reply With Quote #1

About:
  • Displays the TF2 trophy above players heads when they earn an achievement.
  • Can put the player into thirdperson view (L4D2 only).
  • Plugin #1


Example Picture:
A picture is worth a thousand words:




Admin Commands: (requires "z" flag)

PHP Code:
sm_trophy // Display the achievement trophy on yourself. 


CVars:

Saved to l4d_trophy.cfg in your servers \cfg\sourcemod\ folder.

PHP Code:
// 0=Plugin off, 1=Plugin on.
l4d_trophy_allow "1"

// Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
l4d_trophy_modes ""

// Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
l4d_trophy_modes_off ""

// Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
l4d_trophy_modes_tog "0"

// Which effects to display. 1=Trophy, 2=Fireworks, 3=Both.
l4d_trophy_effects "3"

// 0=Off. 1=Play sound when using the command. 2=When achievement is earned (not required for L4D1). 3=Both.
l4d_trophy_sound

// 0.0=Off. How long to put the player into thirdperson view.
l4d_trophy_third "4.0"

// Remove the particle effects after this many seconds. Increase time to make the effect loop.
l4d_trophy_time "3.5"

// Replay the particles after this many seconds.
l4d_trophy_wait "3.5"

// Achievement Trophy plugin version.
l4d_trophy_version 


Changes:
Code:
2.7 (11-Dec-2022)
    - Various changes to tidy up code.

2.6 (10-May-2020)
    - Extra checks to prevent "IsAllowedGameMode" throwing errors.
    - Various changes to tidy up code.

2.5 (01-Apr-2020)
    - Added optional args to "sm_trophy" command to specify a client.
    - Fixed "IsAllowedGameMode" from throwing errors when the "_tog" cvar was changed before MapStart.

2.4.2 (28-Jun-2019)
    - Changed PrecacheParticle method.

2.4.1 (01-Jun-2019)
    - Minor changes to code, has no affect and not required.

2.4 (31-Jul-2018)
    - Added achievement sound. Thanks to "Naomi" for requesting.
    - Added new cvar "l4d_trophy_sound" to control the sound effect.

2.3 (05-May-2018)
    - Converted plugin source to the latest syntax utilizing methodmaps. Requires SourceMod 1.8 or newer.
    - Changed cvar "l4d_trophy_modes_tog" now supports L4D1.

2.2 (25-May-2012)
    - Fixed not creating trophies due to Survivor Thirdperson plugin.

2.1 (21-May-2012)
    - Fixed achievement event using the wrong data. Thanks to "disawar1".

2.0 (20-May-2012)
    - Plugin has been totally re-written. Delete the old plugin and cvars config.
    - Allow and Mode cvars added.
    - Fixed errors being logged.
    - Thirdperson now works for survivors in L4D2 only.

1.4 (04-Oct-2010)
    - retroGamer's versions.

1.3 (30-Aug-2010)
    - Added version cvar.
    - Attempted to cache particles by playing OnClientPutInServer.

1.2 (25-Aug-2010)
    - Added more particles (mini fireworks)!
    - UnhookEvent when plugin turned off.

1.1.1 (25-Aug-2010)
    - Removed 1 event per second limit.

1.1 (25-Aug-2010)
    - Moved event hook from OnMapStart to OnPluginStart.

1.0 (23-Aug-2010)
    - Initial release.


Installation:
  1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.

Updating from 2.3 or older::
  • Delete the old plugin and cvars config from your servers \cfg\sourcemod\ folder.
Attached Files
File Type: sp Get Plugin or Get Source (l4d_achievement_trophy.sp - 686 views - 16.6 KB)
__________________

Last edited by Silvers; 12-10-2022 at 19:32.
Silvers is offline