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

[TF2] Critpoints


Post New Thread Reply   
 
Thread Tools Display Modes
Author
JagDragon
Junior Member
Join Date: Oct 2009
Plugin ID:
1229
Plugin Version:
0.1.3
Plugin Category:
Fun Stuff
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Awards user-triggered critboost for in-game points (Such as killing, capping, blocking, etc)
    Old 10-18-2009 , 03:21   [TF2] Critpoints
    Reply With Quote #1

    This plugin awards players with "critpoints" for accomplishing in-game actions, such as killing, assisting, blocking, capping, etc. These critpoints can be used through a console command bound to a key, which will award that player with a critboost for a certain amount of time.

    This plugin presents a HUD to the player, which shows at the bottom of the screen, just above the objectives. The HUD notifies players of how much crit-time they have to spend, and while they are critboosting it shows them how much time remaining in the critboost.

    This plugin modifies the flags of sv_cheats, and therefore any servers running this plugin will not grant achievements.

    Cvars

    sm_critpoints_enabled (Default 1) - Whether the plugin is active
    sm_critpoints_multiplier (Default 1.0) - Multiply the points by this to get critboost time
    sm_critpoints_max (Default 10) - Max number of crit points a player can have.
    sm_critpoints_default <Default: 10.0> - The default time to use if no second argument is fed to sm_grant_critboost

    Console Commands
    sm_use_crits - Client side command to activate stored critpoints and enable the critboost. This should be bound to something like q or t.

    sm_grant_critboost <#userid|name> <seconds> - Admin command CritBoosts target for a number of seconds. Eg sm_grant_critboost @red 12 will give the red team 12 seconds of crits.

    Todo
    Fully refill upon tauntkill
    Upon a successful tauntkill, the players critpoints should max out.
    Attached Files
    File Type: sp Get Plugin or Get Source (critpoints.sp - 1378 views - 11.3 KB)

    Last edited by psychonic; 12-11-2009 at 13:03. Reason: Removed attached smx because sp compiles on forum
    JagDragon is offline
    retsam
    Veteran Member
    Join Date: Aug 2008
    Location: so-cal
    Old 10-18-2009 , 03:33   Re: Critpoints
    Reply With Quote #2

    Interesting idea. Good job.

    -You can add particle effects and such, or TE's on a player. Its alot of code to paste so, im not going to and it gets kinda complicated on different ways of doing it so...

    -What do you mean it doesnt handle bad targets the way it should?

    -You can do onscreen timers many different ways.. I have multiple plugins that I do this in. One plugin uses CreateHudSynchronizer();, one uses printcentertext and another uses printhinttext. Youd just need to look around and figure out what you like best.

    Personally I think printcentertext is the best for an on-screen timer, but maybe its just me. Printhinttext is nice but plays a sound...: /

    CreateHudSynchronizer(); is cool as you can change the colors and position of the text. Its definitely the most complicated to code though.

    A copy and paste from one of my plugins I do it like this. Other smarter people probably have more efficient better methods, but bleh. This one is fairly simplistic.

    Code:
    IndexTimerCount[client] = 0;
    
    PrintCenterText(client, "%i", GetConVarInt(c_Cvar));        
            CreateTimer(1.0, CritsTimerRepeat, client, TIMER_REPEAT);
    Code:
    public Action:CritsTimerRepeat(Handle:Timer, any:client)
    {
            if(IsClientInGame(client) && IsPlayerAlive(client) && arrayVariableCheckHere[client][#])
            {
                IndexTimerCount[client]++;
                
                PrintCenterText(client, "%i", GetConVarInt(c_Cvar) - IndexTimerCount[client]);
            }
            else{
                KillTimer(Timer);
             
            }
            return Plugin_Continue;
    }

    Last edited by retsam; 10-18-2009 at 03:40.
    retsam is offline
    JagDragon
    Junior Member
    Join Date: Oct 2009
    Old 10-18-2009 , 06:39   Re: [TF2] Critpoints
    Reply With Quote #3

    Thanks for the quick reply, and the constructive comments!

    I have added the errors I receive from the targeting system to the original post, and I am currently getting the HUD working, using CreateHudSynchronizer(), and the timer method you've mentioned in the above post.
    JagDragon is offline
    Jindo
    AlliedModders Donor
    Join Date: May 2009
    Location: England, UK
    Old 10-18-2009 , 06:49   Re: [TF2] Critpoints
    Reply With Quote #4

    Quote:
    Originally Posted by JagDragon View Post
    I don't know why this is happening, since I virtually copy-pasted the targeting code out of funcommands/beacon.sp.
    That will be why, the error is saying that it's missing a translation, make sure that you've loaded any translations required.
    __________________
    Jindo is offline
    JagDragon
    Junior Member
    Join Date: Oct 2009
    Old 10-18-2009 , 07:35   Re: [TF2] Critpoints
    Reply With Quote #5

    Thankyou for that reply, simply adding LoadTranslations("common.phrases"); to my OnPluginStart() method fixed that. I've fixed the bug and re-uploaded the new files.

    Last edited by JagDragon; 10-18-2009 at 07:38.
    JagDragon is offline
    Jindo
    AlliedModders Donor
    Join Date: May 2009
    Location: England, UK
    Old 10-18-2009 , 08:01   Re: [TF2] Critpoints
    Reply With Quote #6

    Quote:
    Originally Posted by JagDragon View Post
    Thankyou for that reply, simply adding LoadTranslations("common.phrases"); to my OnPluginStart() method fixed that. I've fixed the bug and re-uploaded the new files.
    Glad that worked, good job on the plugin!
    __________________
    Jindo is offline
    JagDragon
    Junior Member
    Join Date: Oct 2009
    Old 10-18-2009 , 08:07   Re: [TF2] Critpoints
    Reply With Quote #7

    Yeah, thanks for the translation tip - I was wondering what it was going on about!

    I have added a primitive HUD which shows how many critpoints the player has, and what amount of time they will have for the critboost. I mean to improve on this, maybe add a countdown while the player is critboosting.
    JagDragon is offline
    JagDragon
    Junior Member
    Join Date: Oct 2009
    Old 10-23-2009 , 05:40   Re: [TF2] Critpoints
    Reply With Quote #8

    I have updated this plugin to version 0.1.3, which is stable as far as I know. I have added a working HUD, and the critboost effect now works.

    Enjoy!
    JagDragon is offline
    shahrukh1
    Junior Member
    Join Date: Jun 2009
    Old 12-29-2010 , 21:21   Re: [TF2] Critpoints
    Reply With Quote #9

    doesnt work

    i installed everything

    shows up in the plugins running list

    players get critpoints

    but as soon as they use

    sm_use_crits

    doesnt work

    admin command doesnt either
    shahrukh1 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 08:01.


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