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

Admin Slaughter Reward


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Exolent[jNr] (178)
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 04-04-2009 , 23:23   Admin Slaughter Reward
Reply With Quote #1

Admin Slaughter Reward v1.0
BOYSplayCS

Description:
When you kill an admin with a knife you are rewarded extra money, depending on a cvar. Also, the admin you kill must have the ADMIN_KICK flag or there will be no effect.


Cvars:
amx_adminkill_reward "300" - Sets amount of extra money you earn.


Modules:
Cstrike
Fun


Notice:
I have no idea if this has already been made, I was just having fun with this. Please post your feedback! I tried doing this plugin as efficient and easy as possible. If you are going to offer a code optimization, please exclude hamsandwich. I don't like working with that module.
Attached Files
File Type: sma Get Plugin or Get Source (admin_slaughter.sma - 2882 views - 1,023 Bytes)

Last edited by BOYSplayCS; 04-05-2009 at 00:23. Reason: Uploaded new version
BOYSplayCS is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 04-04-2009 , 23:34   Re: Admin Slaughter Reward
Reply With Quote #2

good plugin and idea
__________________
alan_el_more is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 04-04-2009 , 23:41   Re: Admin Slaughter Reward
Reply With Quote #3

why have you included fun module ?
__________________
Find my plugins here..

Ex - Spanish Moderator.

Last edited by Starsailor; 04-04-2009 at 23:43.
Starsailor is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 04-04-2009 , 23:43   Re: Admin Slaughter Reward
Reply With Quote #4

I accidentally left that in there for another plugin I was creating.
BOYSplayCS is offline
Anggara_nothing
Veteran Member
Join Date: Jan 2009
Location: Indonesia
Old 04-04-2009 , 23:59   Re: Admin Slaughter Reward
Reply With Quote #5

I have question.
What is different between ADMIN_KICK and ADMIN_BAN?
btw, good plugin.
Anggara_nothing is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 04-05-2009 , 00:07   Re: Admin Slaughter Reward
Reply With Quote #6

Curiosity, why do you hate ham?
__________________

Community / No support through PM
danielkza is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 04-05-2009 , 00:11   Re: Admin Slaughter Reward
Reply With Quote #7

@Anggara: There isn't much of a difference, I believe they are the same flags. And thank you

@danielkza: Ham just doesn't seem that easy for me to work with, it uses functions that I don't understand and that have given me tons of issues.
BOYSplayCS is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-05-2009 , 00:18   Re: Admin Slaughter Reward
Reply With Quote #8

Here we go.

1. You can rearrange your death function to only create variables when they are needed.

2. No need to have the weapon array that large when there are no other weapons that have "knife" in the name.

3. There is no need for the variable to hold the players money when it is only used once.

4. You should make sure that the money doesn't exceed the limits.

5. You didn't add a check for team killing.

Code:
public Event_Death() {     new Killer = read_data(1)     new Victim = read_data(2)         if ((Killer == Victim) || !(get_user_flags(Victim) & AdminKilled) || (get_user_team(Victim) == get_user_team(Killer)))         return PLUGIN_CONTINUE         new CheckWeapon[6];     read_data(4, CheckWeapon, 5);         if (equal(CheckWeapon, "knife"))     {         new KillReward = get_pcvar_num(Reward)                 cs_set_user_money(Killer, clamp(cs_get_user_money(Killer) + KillReward, 0, 16000))         client_print(Killer, print_chat, "[AMXX] You have slaughtered an admin! You have been awarded an extra %s dollars!", KillReward)     }     return PLUGIN_HANDLED }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
BOYSplayCS
BANNED
Join Date: Apr 2008
Location: Gainesville, FL
Old 04-05-2009 , 00:21   Re: Admin Slaughter Reward
Reply With Quote #9

@Exolent: If I kept my weapon array at 32, would it make a difference? I'll change it, but I'm just wondering. Also, thank you for your optimization.
BOYSplayCS is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 04-05-2009 , 00:23   Re: Admin Slaughter Reward
Reply With Quote #10

Quote:
Originally Posted by BOYSplayCS View Post
@Anggara: There isn't much of a difference, I believe they are the same flags. And thank you

@danielkza: Ham just doesn't seem that easy for me to work with, it uses functions that I don't understand and that have given me tons of issues.
Did you try looking up hamconst.inc? It has descriptions for most of the functions.

And if it creates you problems there's no reason to use it, but I personally think it's very helpful, using 'proper' hooks instead of workarounds, allowing modification of parameters for hooks, etc.
__________________

Community / No support through PM

Last edited by danielkza; 04-05-2009 at 00:26.
danielkza 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 21:56.


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