AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D & L4D2] Achievement Trophy (2.7) [11-Dec-2022] (https://forums.alliedmods.net/showthread.php?t=136174)

Silvers 08-23-2010 16:14

[L4D & L4D2] Achievement Trophy (2.7) [11-Dec-2022]
 
9 Attachment(s)
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:

http://i.imgur.com/Q1xI3jg.jpg


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.

Searcher64 08-23-2010 17:10

Re: [L4D & L4D2] Achievement Trophy
 
This....is....amazing......thank you.....

Silvers 08-23-2010 17:14

Re: [L4D & L4D2] Achievement Trophy
 
Thanks, I can't take much credit. But it's something different and not done before.


* Thanks to "L. Duke" for " TF2 Particles via TempEnts" tutorial
http://forums.alliedmods.net/showthread.php?t=75102

* Thanks to "Muridias" for updating "L. Duke"s code
http://forums.alliedmods.net/showpos...6&postcount=28

* Thanks to "panxiaohai" for "l4d_3rdnotbind_en" which is the ThirdPerson view
http://forums.alliedmods.net/showpos...0&postcount=23



Any bugs let me know, there shouldn't be any though it's quite simple.

Fleepster99 08-23-2010 17:30

Re: [L4D & L4D2] Achievement Trophy
 
Very fun plugin, and useful code 2 thanks.

ldoh0112 08-24-2010 10:38

Re: [L4D & L4D2] Achievement Trophy
 
very good plugin, thank you :)

dirka_dirka 08-24-2010 12:54

Re: [L4D & L4D2] Achievement Trophy
 
why do you constantly hook the event? thats why it triggers more then 1ce a second.

IronWarrior 08-24-2010 13:27

Re: [L4D & L4D2] Achievement Trophy
 
Do players need to download anything?

I don't see how that trophy is already in the game for it to be used?

If this works as intended, then it's great.

Silvers 08-24-2010 14:13

Re: [L4D & L4D2] Achievement Trophy
 
Quote:

Originally Posted by dirka_dirka (Post 1280688)
why do you constantly hook the event? thats why it triggers more then 1ce a second.

Well I only just started and following from examples, what is the correct place to hook? OnPluginStart? I was also considering for multipule achievements unlocked at once, usually end of a round though.



Quote:

Originally Posted by IronWarrior (Post 1280713)
Do players need to download anything?

No, it's already within the pak files :D

McFlurry 08-24-2010 16:03

Re: [L4D & L4D2] Achievement Trophy
 
Yeah it works apparently they keep particles from previous games. :mrgreen:
Hook the event on OnPluginStart() or else it will fire 1 more time than the last each time the map changes.

dirka_dirka 08-24-2010 23:15

Re: [L4D & L4D2] Achievement Trophy [24-Aug-2010 - v1.1.1]
 
yes one time in onpluginstart works.

but since you have an enable cvar.. you could also toggle the hook when the plugin is enabled/disabled
make a function Enabled() { // hook } and a function Disabled() { // unhook }
then call those functions as the enabled cvar is changed


All times are GMT -4. The time now is 04:50.

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