Raised This Month: $ Target: $400
 0% 

Team Killing Bonus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Snafu
Junior Member
Join Date: Oct 2008
Old 10-07-2008 , 15:15   Team Killing Bonus
Reply With Quote #1

So, I've looked through a couple pieces of source code for TK revenge scripts in hopes to find a way to modify the lost of a point, and add a point for TKs. Of course my search was unsuccessful.

So, I'm here to ask, is this even possible? I've spent hours going through the sourcemod functions, and found nothing. I'm hoping I overlooked something. Thanks in advance.
Snafu is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 10-07-2008 , 15:37   Re: Team Killing Bonus
Reply With Quote #2

Quote:
Originally Posted by Snafu View Post
So, I've looked through a couple pieces of source code for TK revenge scripts in hopes to find a way to modify the lost of a point, and add a point for TKs. Of course my search was unsuccessful.

So, I'm here to ask, is this even possible? I've spent hours going through the sourcemod functions, and found nothing. I'm hoping I overlooked something. Thanks in advance.
Erm.....do i get that right? You want to add a kill to the scores of
a teamkiller?
FeuerSturm is offline
Snafu
Junior Member
Join Date: Oct 2008
Old 10-07-2008 , 17:33   Re: Team Killing Bonus
Reply With Quote #3

Yes, that is correct.
Snafu is offline
FeuerSturm
AlliedModders Donor
Join Date: Apr 2004
Old 10-08-2008 , 01:00   Re: Team Killing Bonus
Reply With Quote #4

Quote:
Originally Posted by Snafu View Post
Yes, that is correct.
PHP Code:
SetEntProp(clientProp_Data"m_iFrags"GetClientFrags(client)+1
I don't know why someone would bonus a teamkiller, anyways,
the above code should work
FeuerSturm is offline
Snafu
Junior Member
Join Date: Oct 2008
Old 10-08-2008 , 13:36   Re: Team Killing Bonus
Reply With Quote #5

Awesome, thanks! Yeah, it's an odd request, but there is a point to it all.
Snafu is offline
Snafu
Junior Member
Join Date: Oct 2008
Old 10-08-2008 , 15:35   Re: Team Killing Bonus
Reply With Quote #6

Sorry for my ignorance, but something isn't working, and I can't see what I'm overlooking. Here's what I have so far.

Code:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_VERSION "0.1"


public OnPluginLoad()
{
    HookEvent("player_death",Event_PlayerDeath);
}

public Action:Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
{
    new clientID = GetEventInt(event,"userid");
    new client = GetClientOfUserId(clientID);
    SetEntProp(client, Prop_Data, "m_iFrags", GetClientFrags(client)+1);
}
It compiles without errors, and is show in the sm plugin list. Also, zero errors from the console.

Thanks in advance.
Snafu 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 14:25.


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