Raised This Month: $32 Target: $400
 8% 

[L4D] Hunter Distance Meter


Post New Thread Reply   
 
Thread Tools Display Modes
Author
olj
Veteran Member
Join Date: Jun 2009
Plugin ID:
1134
Plugin Version:
1.1, 1.2,1.3
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Calculates distance between crouching hunter and entities he is looking at.
    Old 09-04-2009 , 12:23   [L4D] Hunter Distance Meter
    Reply With Quote #1

    Well, i got request from one of my comrades, and made this small utility.

    CVARS
    l4d_dmeter_version Plugin version
    l4d_dmeter_enabled (Default 1, enabled) Enabled/Disabled cvar


    Commands for 1.1 version: /distance or !distance in chat will activate distance calculating timer which will print distance into center text (above crosshair) for crouching hunters.

    1.2 version works with SM 1.3 only, but is more convenient, as it activates whenever hunter crouching

    1.3 version added, see changelog.

    Credits
    One of my comrades for idea.
    Atomic Striker for info.
    And p3tsin for this thread http://forums.alliedmods.net/showthr...168#post885168
    Everyone on the alliedmods.net.
    Valve for great game.

    Things to do
    Change infected type detection from GetClientModel to class property.

    Changelog

    1.1 Included trace system, using trace functions (thanx Atomic Striker), try new version. Should get distance between anything.
    1.2 SM 1.3 version - autoactivates when hunter crouch.
    1.3 Modified by Dragonshadow. Will compile as 1.2 or 1.3 version depending on your SM version. Added enabled/disabled cvar. Take a note - if you compile on forum it will be compiled as 1.2 version. EDIT: To make it more clear - 1.2 version now uses OnGameFrame and autoactivating on crouching.
    Attached Files
    File Type: sp Get Plugin or Get Source (DistanceMeter 1.1.sp - 1968 views - 4.1 KB)
    File Type: sp Get Plugin or Get Source (DistanceMeter 1.2.sp - 2103 views - 2.9 KB)
    File Type: sp Get Plugin or Get Source (DistanceMeter 1.3.sp - 3623 views - 5.8 KB)
    __________________

    Last edited by olj; 10-03-2009 at 03:40.
    olj is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 09-04-2009 , 12:28   Re: [L4D] Hunter Distance Meter
    Reply With Quote #2

    And, right after this.

    One more question - is it possible to calculate distance between client and spot where he is aiming at?
    Btw, forgot version cvar
    __________________
    olj is offline
    AtomicStryker
    Veteran Member
    Join Date: Apr 2009
    Location: Teutonia!!
    Old 09-04-2009 , 12:39   Re: [L4D] Hunter Distance Meter
    Reply With Quote #3

    PHP Code:
        decl Float:vAngles[3], Float:vOrigin[3], Float:vStart[3], Float:Distance;
        
        
    GetClientEyePosition(client,vOrigin);
        
    GetClientEyeAngles(clientvAngles);
        
         new 
    Handle:trace TR_TraceRayFilterEx(vOriginvAnglesMASK_SHOTRayType_InfiniteTraceEntityFilterPlayer);
        
        if(
    TR_DidHit(trace))
        {        
            
    TR_GetEndPosition(vStarttrace);
            
    Distance GetVectorDistance(vOriginvStartfalse);
        } 

    Last edited by AtomicStryker; 09-04-2009 at 12:42.
    AtomicStryker is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 09-04-2009 , 13:02   Re: [L4D] Hunter Distance Meter
    Reply With Quote #4

    That simple? lol. Thanx. I will include it in code then.
    __________________
    olj is offline
    Guinn
    Junior Member
    Join Date: Sep 2009
    Old 09-04-2009 , 18:20   Re: [L4D] Hunter Distance Meter
    Reply With Quote #5

    is it possible to hook it to the reload or crouch key or something so that you don't have to stop and type?

    Last edited by Guinn; 09-04-2009 at 18:23.
    Guinn is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 09-05-2009 , 03:17   Re: [L4D] Hunter Distance Meter
    Reply With Quote #6

    Quote:
    Originally Posted by Guinn View Post
    is it possible to hook it to the reload or crouch key or something so that you don't have to stop and type?
    Yes, dont know why reload key though. Crouch is better of course, i will release few new versions, and you test.
    __________________
    olj is offline
    Zverina
    Senior Member
    Join Date: Aug 2009
    Location: California, USA
    Old 09-05-2009 , 14:57   Re: [L4D] Hunter Distance Meter
    Reply With Quote #7

    arg no i must test this lulz this plugin seems perfect for the hunter brutal pounce plugin
    Zverina is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 09-05-2009 , 20:49   Re: [L4D] Hunter Distance Meter
    Reply With Quote #8

    Ok, the 1.1 version works and its much better. I will add version for sourcemod 1.3 which will activate this on hunter crouch without need of any commands.

    EDIT: Added SM 1.3 version REALLY AWESOME, at least i like it personally and never remove from my plugins
    __________________

    Last edited by olj; 09-06-2009 at 07:55.
    olj is offline
    Guinn
    Junior Member
    Join Date: Sep 2009
    Old 09-06-2009 , 12:24   Re: [L4D] Hunter Distance Meter
    Reply With Quote #9

    oh very nice! thanks. i modified it to do feet and added feet to the output. i did this to match my pounce announce output. it might be a good idea to give the option for units, metric, feet
    Guinn is offline
    Antithasys
    Moderator
    Join Date: Apr 2008
    Old 09-06-2009 , 19:37   Re: [L4D] Hunter Distance Meter
    Reply With Quote #10

    Looks good. Only issue is your public cvar.

    You have a public cvar in your code:
    PHP Code:
    CreateConVar("l4d_distance_meter_version"PLUGIN_VERSION"Version of Distance Meter"FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY); 
    ...but... it's to long. I think the top is 24chars. That's technically ok, but game-monitor.com will truncate it.

    The other problem is you did not include this (your public) cvar in the posts description.

    Fix and it will be approved.

    Thanks.
    __________________
    [my plugins]

    When you think about asking a question... consider what have you tried?
    Antithasys is offline
    Reply



    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 01:23.


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