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

If you kill a teammate twice, banned.


Post New Thread Reply   
 
Thread Tools Display Modes
fireattack
Senior Member
Join Date: Jul 2008
Old 07-23-2011 , 12:49   Re: If you kill a teammate twice, banned.
Reply With Quote #11

PHP Code:
new g_LeftKills32 ]; 
new 
boolg_IsStarted;

public 
plugin_init( ) 
    
register_event"DeathMsg""tk""a" );

public 
tk( ) 
{
    new 
killer read_data);
    new 
victim read_data);

    if( 
g_IsStarted )
    {
        if( ( 
cs_get_user_teamkiller ) == cs_get_user_teamvictim ) ) ) 
        {
            if( 
g_LeftKills )
                
g_LeftKillskiller ] ++;
            else
                
server_cmd"amx_ban #%d 60 Team-Kills are not allowed!"get_user_useridkiller ) );
    }

Try.

Last edited by fireattack; 07-24-2011 at 16:13.
fireattack is offline
nikhilgupta345
Veteran Member
Join Date: Aug 2009
Location: Virginia
Old 07-23-2011 , 13:14   Re: If you kill a teammate twice, banned.
Reply With Quote #12

@Diegorkable if you didn't see what fireattack changed, your main problems were that DeathMsg must be registered as a global event (flag "a" not "b"), and also, you weren't incrementing the value of g_LeftKills
__________________
Quote:
Originally Posted by DarkGod View Post
nikhilgupta generates his plugins using sheer awesome.
If you like my work, please
nikhilgupta345 is offline
Send a message via ICQ to nikhilgupta345 Send a message via Yahoo to nikhilgupta345
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-23-2011 , 16:18   Re: If you kill a teammate twice, banned.
Reply With Quote #13

Quote:
Originally Posted by nikhilgupta345 View Post
you weren't incrementing the value of g_LeftKills
He wasn't incrementing because he is counting backward. He starts at 2 and decrements it. I think it will work once the register_event() is fixed.

However, if it really was debugged then he should have known that the function was not getting called at all.
__________________

Last edited by fysiks; 07-23-2011 at 17:51. Reason: typo
fysiks is online now
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 07-23-2011 , 17:45   Re: If you kill a teammate twice, banned.
Reply With Quote #14

use

http://www.amxmodx.org/funcwiki.php?go=func&id=898

and check if TK is true
DjOptimuS is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 19:37   Re: If you kill a teammate twice, banned.
Reply With Quote #15

I'll try to just edit the register_event like fysiks said to "a", then see if it works, if won't i'll use the code fix fireattack posted, ty fireattack. if that doesnt work aswell, i'll try that public client_death, it looks good and useful.
Diegorkable is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-24-2011 , 01:11   Re: If you kill a teammate twice, banned.
Reply With Quote #16

fireattack's plugin will require 3 kills before a ban and it is hardcoded to only work properly on a server with less than 11 slots.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
fireattack
Senior Member
Join Date: Jul 2008
Old 07-24-2011 , 15:02   Re: If you kill a teammate twice, banned.
Reply With Quote #17

Quote:
Originally Posted by wrecked_ View Post
fireattack's plugin will require 3 kills before a ban and it is hardcoded to only work properly on a server with less than 11 slots.
Read it again and then check "<" not "<=".

I think this is for a mixmaker so don't need more than 10 players.
fireattack is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-24-2011 , 16:01   Re: If you kill a teammate twice, banned.
Reply With Quote #18

Quote:
Originally Posted by fireattack View Post
Read it again and then check "<" not "<=".

I think this is for a mixmaker so don't need more than 10 players.
No, wrecked is correct. It will require 3 TKs to get banned because g_LeftKills[id] is initialized to 0. However, if someone else joins in that same slot they will be banned for 1 TK.
__________________
fysiks is online now
fireattack
Senior Member
Join Date: Jul 2008
Old 07-24-2011 , 16:14   Re: If you kill a teammate twice, banned.
Reply With Quote #19

Yes, I was wrong.

So working now .
fireattack 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 02:21.


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