Raised This Month: $12 Target: $400
 3% 

[L4D & L4D2] Achievement Trophy (2.7) [11-Dec-2022]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
1907
Plugin Version:
2.7
Plugin Category:
Fun Stuff
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    40 
    Plugin Description:
    Displays the TF2 trophy when somebody unlocks an achievement, also can switch display in ThirdPerson view.
    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 - 638 views - 16.6 KB)
    __________________

    Last edited by Silvers; 12-10-2022 at 19:32.
    Silvers is offline
    Searcher64
    Senior Member
    Join Date: Apr 2010
    Old 08-23-2010 , 17:10   Re: [L4D & L4D2] Achievement Trophy
    Reply With Quote #2

    This....is....amazing......thank you.....
    Searcher64 is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 08-23-2010 , 17:14   Re: [L4D & L4D2] Achievement Trophy
    Reply With Quote #3

    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.
    Silvers is offline
    Fleepster99
    Senior Member
    Join Date: Apr 2010
    Old 08-23-2010 , 17:30   Re: [L4D & L4D2] Achievement Trophy
    Reply With Quote #4

    Very fun plugin, and useful code 2 thanks.
    Fleepster99 is offline
    ldoh0112
    Member
    Join Date: Nov 2009
    Location: The Republic of Korea
    Old 08-24-2010 , 10:38   Re: [L4D & L4D2] Achievement Trophy
    Reply With Quote #5

    very good plugin, thank you
    ldoh0112 is offline
    dirka_dirka
    Veteran Member
    Join Date: Nov 2009
    Old 08-24-2010 , 12:54   Re: [L4D & L4D2] Achievement Trophy
    Reply With Quote #6

    why do you constantly hook the event? thats why it triggers more then 1ce a second.
    dirka_dirka is offline
    IronWarrior
    Veteran Member
    Join Date: Jan 2010
    Old 08-24-2010 , 13:27   Re: [L4D & L4D2] Achievement Trophy
    Reply With Quote #7

    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.
    IronWarrior is offline
    Silvers
    SourceMod Plugin Approver
    Join Date: Aug 2010
    Location: SpaceX
    Old 08-24-2010 , 14:13   Re: [L4D & L4D2] Achievement Trophy
    Reply With Quote #8

    Quote:
    Originally Posted by dirka_dirka View Post
    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 View Post
    Do players need to download anything?
    No, it's already within the pak files
    Silvers is offline
    McFlurry
    Veteran Member
    Join Date: Mar 2010
    Location: RemoveEdict(0);
    Old 08-24-2010 , 16:03   Re: [L4D & L4D2] Achievement Trophy
    Reply With Quote #9

    Yeah it works apparently they keep particles from previous games.
    Hook the event on OnPluginStart() or else it will fire 1 more time than the last each time the map changes.
    __________________
    McFlurry is offline
    Send a message via Skype™ to McFlurry
    dirka_dirka
    Veteran Member
    Join Date: Nov 2009
    Old 08-24-2010 , 23:15   Re: [L4D & L4D2] Achievement Trophy [24-Aug-2010 - v1.1.1]
    Reply With Quote #10

    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
    dirka_dirka is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 21:27.


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