Raised This Month: $ Target: $400
 0% 

If you kill a teammate twice, banned.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 11:18.


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