AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Store (https://forums.alliedmods.net/forumdisplay.php?f=157)
-   -   Release [Store] Kill Awards (https://forums.alliedmods.net/showthread.php?t=210586)

eXemplar 03-12-2013 10:18

[Store] Kill Awards
 
[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.

mickael002 03-12-2013 11:47

Re: [Store] Kill Awards
 
Thanks, did you have commands ?

404UserNotFound 03-12-2013 15:13

Re: [Store] Kill Awards
 
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.

eXemplar 03-12-2013 19:53

Re: [Store] Kill Awards
 
Quote:

Originally Posted by abrandnewday (Post 1911453)
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.

404UserNotFound 03-12-2013 20:13

Re: [Store] Kill Awards
 
Quote:

Originally Posted by eXemplar (Post 1911621)
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."
// ------------------------------------------------------------------------------- 


eXemplar 03-12-2013 21:30

Re: [Store] Kill Awards
 
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 :P

404UserNotFound 03-12-2013 21:48

Re: [Store] Kill Awards
 
Quote:

Originally Posted by eXemplar (Post 1911674)
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 :P

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 :P 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! :P)

alongub 03-12-2013 21:56

Re: [Store] Kill Awards
 
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.

404UserNotFound 03-12-2013 22:28

Re: [Store] Kill Awards
 
Quote:

Originally Posted by alongub (Post 1911687)
make sure that the client is in-game, just for extra safety.

I've got a primo ingame check you can use :P (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.

eXemplar 03-12-2013 22:31

Re: [Store] Kill Awards
 
Quote:

Originally Posted by alongub (Post 1911687)
[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 (Post 1911687)
[LIST][*]Instead of implementing your own GiveCreditsToClient, just use Store_GiveCredits.

Cool, missed that. Thanks.
Quote:

Originally Posted by alongub (Post 1911687)
  • There's no point in implementing both int and bool filters, as they are both cells.

Noted.

Quote:

Originally Posted by abrandnewday (Post 1911680)
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 :P

Good luck, maybe I can ... leverage some of your code ;)


All times are GMT -4. The time now is 11:53.

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