Raised This Month: $ Target: $400
 0% 

Team Killing OFF ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ex3cuTioN
Member
Join Date: May 2010
Old 08-16-2010 , 08:37   Team Killing OFF ?
Reply With Quote #1

I saw on a respawn server, i could kill my team and +1 frags.

On that server i could kill everyone i saw, ct's and t's.

How ? can you give/make the plugin
Ex3cuTioN is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 08-16-2010 , 09:12   Re: Team Killing OFF ?
Reply With Quote #2

Quote:
Originally Posted by Ex3cuTioN View Post
I saw on a respawn server, i could kill my team and +1 frags.

On that server i could kill everyone i saw, ct's and t's.

How ? can you give/make the plugin
This is the scripting help forum so I'm gonna guess you know how to script, if not, go to suggestions/requests.

You can use ham sandwich and cstrike and fun for this.

Ham Sandwich - For registering Ham_Killed and call an event on death.
Cstrike - Much more simple when retrieving teams (just my thought)
Fun - Setting user frags.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN    "Team Killing"
#define AUTHOR    "Shadow"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHamHam_Killed"player""Death")
}

public 
Death(iVictimiAttacker)
{
    if( 
iVictim == iAttacker )
    {
        return 
PLUGIN_HANDLED;
    }
    
    if( 
cs_get_user_team(iVictim) == CS_TEAM_T && cs_get_user_team(iAttacker) == CS_TEAM_T )
    {
        new 
frags get_user_frags(iAttacker)
        
set_user_frags(iAttackerfrags 2)
        
        return 
PLUGIN_HANDLED;
    }
    
    if( 
cs_get_user_team(iVictim) == CS_TEAM_CT && cs_get_user_team(iAttacker) == CS_TEAM_CT )
    {
        new 
frags get_user_frags(iAttacker)
        
set_user_frags(iAttackerfrags 2)
        
         return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_HANDLED;

Probably not the best method.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-16-2010 , 09:51   Re: Team Killing OFF ?
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>

#define VERSION "0.0.3"

#define MAX_PLAYERS    32

#define TEAM_T        1
#define TEAM_CT    2

#define XO_PLAYER    5
#define m_iTeam    114

#define cs_get_user_team_index(%1)        get_pdata_int(%1, m_iTeam, XO_PLAYER)
#define cs_set_user_team_index(%1,%2)    set_pdata_int(%1, m_iTeam, %2, XO_PLAYER)

#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )

new g_iMaxPlayers
new g_iVictimTeam
new HamHook:g_iHhTakeDamagePost

public plugin_init()
{
    
register_plugin("Real FriendlyFire"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_TakeDamage"player""Player_TakeDamage_Pre")
    
g_iHhTakeDamagePost RegisterHam(Ham_TakeDamage"player""Player_TakeDamage_Post"1)
    
DisableHamForwardg_iHhTakeDamagePost )

    
g_iMaxPlayers get_maxplayers()
}

public 
Player_TakeDamage_Pre(iVictimiInflictoriAttacker)
{
    if( 
IsPlayeriAttacker ) && iVictim != iAttacker )
    {
        
g_iVictimTeam cs_get_user_team_index(iVictim)
        if( 
g_iVictimTeam == cs_get_user_team_index(iAttacker) )
        {
            
cs_set_user_team_index(iVictimg_iVictimTeam == TEAM_T TEAM_CT TEAM_T)
            
EnableHamForwardg_iHhTakeDamagePost )
            return 
HAM_HANDLED
        
}
    }
    return 
HAM_IGNORED
}

public 
Player_TakeDamage_Post(iVictim)
{
    
cs_set_user_team_index(iVictimg_iVictimTeam)
    
DisableHamForwardg_iHhTakeDamagePost )

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-17-2010 , 00:00   Re: Team Killing OFF ?
Reply With Quote #4

I'm wondering, is there any chance that your g_iVictimTeam be overwritten by paralel ham_damage ?
__________________
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-17-2010 , 08:10   Re: Team Killing OFF ?
Reply With Quote #5

Unless another plugin hook takedamage and send a new one, it shouldn't happen.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Old 08-17-2010, 08:57
GXLZPGX
This message has been deleted by GXLZPGX. Reason: I'm retarded.
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 22:02.


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