Raised This Month: $32 Target: $400
 8% 

If you kill a teammate twice, banned.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 10:12   If you kill a teammate twice, banned.
Reply With Quote #1

Hey guys, I registered an event, that it'll hopefully work, that like the title says, if you TK twice you get banned for 1 minute, for some reason it doesnt work, maybe the register i did is not correct since im not familliar with it:

PHP Code:
/* Global */
new g_LeftKills[11]   // It is set to 2 when a client connects, look at public client_connect()
new bool:g_IsStarted     // When a match starts it is set to true, trust me it works cuz i tested it. 
/* Global */


public plugin_init()
{
        
register_event("DeathMsg""tk""b")
}

public 
client_connect(id)
{
      
g_LeftKills[id] = 2
}

public 
tk()
{
    new 
killer read_data(1)
    new 
victim read_data(2)
    
    if (
g_IsStarted)
    {
        if ((
cs_get_user_team(killer) == cs_get_user_team(victim)))
        {
            if (
g_LeftKills[killer] == 2)
            {
                
client_print(killerprint_chat"%s Warning! DO NOT Team-Kill, 1 more TK and you will be banned."PREFIX)
                
client_print(killerprint_chat"%s Warning! DO NOT Team-Kill, 1 more TK and you will be banned."PREFIX)
                
g_LeftKills[killer]--
            }
            
            else if (
g_LeftKills[killer] == 1)
            {
                
server_cmd("amx_ban #%d 60 Team-Kills are not allowed!"get_user_userid(killer))
            }
        }
    }

Diegorkable is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-23-2011 , 10:27   Re: If you kill a teammate twice, banned.
Reply With Quote #2

"mp_autokick 1"
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 10:58   Re: If you kill a teammate twice, banned.
Reply With Quote #3

Thanks but no thanks, can someone now please tell me whats wrong with my code?

mp_autokick just kicks him if he TKs, and not at the number of times I want, except that, it doesnt ban, the player can get kicked, relog, and TK again, so no thanks.
Diegorkable is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-23-2011 , 11:06   Re: If you kill a teammate twice, banned.
Reply With Quote #4

"Enables automatic team-killer banning."
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 11:11   Re: If you kill a teammate twice, banned.
Reply With Quote #5

Dude, just leave that mp_autokick alone, if you can't help me with the code i posted dont. Still thanks for the suggestion.
Diegorkable is offline
HBxander
Senior Member
Join Date: Jan 2011
Location: Behind you!
Old 07-23-2011 , 11:14   Re: If you kill a teammate twice, banned.
Reply With Quote #6

PHP Code:
new boolg_IsStarted 
returns to? you only use it here:
PHP Code:
if(g_IsStarted
and its always false, when you dont change it.
Im 99% sure about thats the bug.
__________________
Selling:

- PointMod for Hide And Seek - $20
- Private BlockMaker with Weapon Block And More - $50
- Achievements ( FFA GamePlay ) - $25

PM Me about Private Work!

Last edited by HBxander; 07-23-2011 at 11:19.
HBxander is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 11:50   Re: If you kill a teammate twice, banned.
Reply With Quote #7

I said in the code..... g_IsStarted is true when a MATCH STARTS, you dont see it here cuz i didnt post the code, once again, i tested it, and g_IsStarted turns true.
Diegorkable is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-23-2011 , 12:22   Re: If you kill a teammate twice, banned.
Reply With Quote #8

Debug it then.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Diegorkable
Veteran Member
Join Date: Jun 2011
Old 07-23-2011 , 12:23   Re: If you kill a teammate twice, banned.
Reply With Quote #9

...... I did, the reason I post here is because I've already done it and can't figure out whats going on.
Diegorkable is offline
bibu
Veteran Member
Join Date: Sep 2010
Old 07-23-2011 , 12:25   Re: If you kill a teammate twice, banned.
Reply With Quote #10

Quote:
Originally Posted by Diegorkable View Post
...... I did.
Show what you did? The best would be do add some messages, then you can at least see till when the plugin works.
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
Reply


Thread Tools
Display Modes

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 00:54.


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