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

Release [Store] Kill Awards


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eXemplar
Member
Join Date: Feb 2013
Old 03-12-2013 , 10:18   [Store] Kill Awards
Reply With Quote #1

[Store] Kill Awards


Description:
Store module that awards players with credits when they kill another player.

Requirements:
Features:
  • Award Kills - Award players with points on kill
  • Filters - Customisable options for points on headshots, different weapons, dominations, etc

Download:
https://github.com/eggsampler/store-killawards

Notes:
This module should be mod-independent, but please test and let me know if you have any issues. Any feedback is welcome.

Last edited by eXemplar; 03-12-2013 at 10:19.
eXemplar is offline
mickael002
Senior Member
Join Date: Jul 2010
Old 03-12-2013 , 11:47   Re: [Store] Kill Awards
Reply With Quote #2

Thanks, did you have commands ?
__________________
mickael002 is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-12-2013 , 15:13   Re: [Store] Kill Awards
Reply With Quote #3

Fancy, yet simple.

I'm working on my own, more advanced version of a "kill awards" plugin, which will be for TF2 and it will feature numerous ConVars that will allow server owners to choose how many credits to give a player for killing another player/destroying Engineer buildings/winning a round/etc.

I compared the way your plugin gives credits, to the way mine does, and yours is just...wow. I'm no expert coder, but that is some pretty advanced looking stuff. Mine is really, really simple D:

Good work though!

EDIT: I also just noticed that this plugin seems to be for CS:S or CS:GO.

Last edited by 404UserNotFound; 03-12-2013 at 15:44.
404UserNotFound is offline
eXemplar
Member
Join Date: Feb 2013
Old 03-12-2013 , 19:53   Re: [Store] Kill Awards
Reply With Quote #4

Quote:
Originally Posted by abrandnewday View Post
I also just noticed that this plugin seems to be for CS:S or CS:GO.
It should work with any mod that has userid and attacker fields in the player_death event, which as far as I'm aware is most (if not all) mods.

If you want to hold off a few days on your TF2 dealio I'll be looking at making this more generic into a "tasks" system, which let you give points based on any game event all done via config file. Should be relatively easy, just think I'm going to have to hardcode some common conditions (like same team) which some events would use.

Last edited by eXemplar; 03-12-2013 at 19:55.
eXemplar is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-12-2013 , 20:13   Re: [Store] Kill Awards
Reply With Quote #5

Quote:
Originally Posted by eXemplar View Post
It should work with any mod that has userid and attacker fields in the player_death event, which as far as I'm aware is most (if not all) mods.

If you want to hold off a few days on your TF2 dealio I'll be looking at making this more generic into a "tasks" system, which let you give points based on any game event all done via config file. Should be relatively easy, just think I'm going to have to hardcode some common conditions (like same team) which some events would use.
I would hold off, but I'm actually very close to being done. I've just hit a snag or two with some of the events and the way I want to set them up. As I said earlier, I like your plugin, but it's very simplistic. The one I'm working on takes everything in TF2 into account, and enables a wide range of customization in the amount of credits you can get for getting kills via certain methods. For example, the event for when a player captures a point. I'm making it give all the players who captured a point some credits, then there's an additional CVAR that can be enabled to give the entire team a bonus amount of credits if one or more of their players captures the point.

As well, I've got it set up to use the Updater plugin, and I signed up over at BitBucket.org, so I can commit new versions whenever TF2 updates include new weapons or events, or if there's bugs to be fixed. As for config files, I'm just going to have mine do AutoExecConfig for now, just so I can get the plugin finished, and start testing it. If I feel like it, I might try my hand at making it use a config file like this one does.

OH, and by the way, I have to thank you. By checking this plugin's source code, I learned about the "new string: g_currencyname[64];" thing that I didn't know about originally, and I've been able to start converting my standard PrintToChat functions to use g_currencyname, and also utilize a translations file. I've already credited you in my "Credits & Special Thanks" part of the plugin's source code;

PHP Code:
// -------------------------------------------------------------------------------
// eXemplar
// I got the 'currencyname' stuff from his "[Store] Kill Awards" plugin. I had no
// prior clue about the "currencyname" string stuff before I looked at the source
// code of his plugin, then I was like "Oh snap, I should really implement that."
// ------------------------------------------------------------------------------- 

Last edited by 404UserNotFound; 03-12-2013 at 20:14.
404UserNotFound is offline
eXemplar
Member
Join Date: Feb 2013
Old 03-12-2013 , 21:30   Re: [Store] Kill Awards
Reply With Quote #6

Well the idea behind a tasks system would be any changes to the game or events is just a matter of changing a few lines in a config file and everything you have said can be done there - which is much easier for everyone to do than waiting for a plugin update, but go nuts.

PS, the currency name stuff is in the distributor plugin
eXemplar is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-12-2013 , 21:48   Re: [Store] Kill Awards
Reply With Quote #7

Quote:
Originally Posted by eXemplar View Post
Well the idea behind a tasks system would be any changes to the game or events is just a matter of changing a few lines in a config file and everything you have said can be done there - which is much easier for everyone to do than waiting for a plugin update, but go nuts.

PS, the currency name stuff is in the distributor plugin
Or I could just hop into the source code of this plugin and rip out the config file setup that you've got and mess around with it and make my own tasks system At this point in time though, I'm just focusing on getting everything in working order.

And I didn't even notice it in the distributor plugin (boy do I feel dumb! )
404UserNotFound is offline
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 03-12-2013 , 21:56   Re: [Store] Kill Awards
Reply With Quote #8

Nice!

Just a few things:
  • In Event_PlayerDeath, you should probably make sure that the client is in-game, just for extra safety.
  • Instead of implementing your own GiveCreditsToClient, just use Store_GiveCredits.
  • There's no point in implementing both int and bool filters, as they are both cells.
__________________
alongub is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 03-12-2013 , 22:28   Re: [Store] Kill Awards
Reply With Quote #9

Quote:
Originally Posted by alongub View Post
make sure that the client is in-game, just for extra safety.
I've got a primo ingame check you can use (I found it on the forums in an old thread from a year ago):

PHP Code:
new bool:IsClientInGame[4096];

public 
OnClientPutInServer(client)
{
    
IsClientInGame[client] = true;
}

public 
OnClientDisconnect_Post(client)
{
    
IsClientInGame[client] = false;

Then to do a check,

PHP Code:
if (IsClientInGame[client] == true)
if (
IsClientInGame[client] == false
It's simple, and I don't have to worry about "which IsValidClient function is the right one?" because there's like a hundred variations of IsValidClient, some that have "return IsClientInGame", some that do checks to see if the player is a SourceTV client, etc, etc.
404UserNotFound is offline
eXemplar
Member
Join Date: Feb 2013
Old 03-12-2013 , 22:31   Re: [Store] Kill Awards
Reply With Quote #10

Quote:
Originally Posted by alongub View Post
[LIST][*]In Event_PlayerDeath, you should probably make sure that the client is in-game, just for extra safety.
Is there really a need for this? Shouldn't they receive (or lose) the points whether they're in game or not?
Quote:
Originally Posted by alongub View Post
[LIST][*]Instead of implementing your own GiveCreditsToClient, just use Store_GiveCredits.
Cool, missed that. Thanks.
Quote:
Originally Posted by alongub View Post
  • There's no point in implementing both int and bool filters, as they are both cells.
Noted.

Quote:
Originally Posted by abrandnewday View Post
Or I could just hop into the source code of this plugin and rip out the config file setup that you've got and mess around with it and make my own tasks system
Good luck, maybe I can ... leverage some of your code ;)
eXemplar 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 07:21.


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