Raised This Month: $ Target: $400
 0% 

[INC] Colors (1.0.5)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
KALASH NICOLE
Member
Join Date: Feb 2016
Old 05-09-2017 , 05:10   Re: [INC] Colors (1.0.5)
Reply With Quote #33

hi, i want to add red color to the chat message of this code (printtochatall and kickclient):

could you repost it with the correct code ?

PHP Code:
ConVar sm_teamkill_limit;

public 
void OnPluginStart()
{
    
sm_teamkill_limit CreateConVar("sm_teamkill_limit""3""The limit before of team kill before kicking the player"FCVAR_NONEtrue0.0);
    
HookEventEx("round_start"event);
    
HookEventEx("player_death"event);
    
HookEventEx("player_disconnect"event);
}

public 
void event(Event event, const char[] namebool dontBroadcast)
{
    static 
int teamkill_counts[MAXPLAYERS+1];

    if(
sm_teamkill_limit.IntValue <= 0) return;

    if(
StrEqual(name"round_start"))
    {
        for(
int x 1<= MaxClientsx++)
        {
            
teamkill_counts[x] = 0;
        }
        return;
    }

    if(
StrEqual(name"player_disconnect"))
    {
        
teamkill_counts[GetClientOfUserId(event.GetInt("userid"))] = 0;
        return;
    }

    
int victim GetClientOfUserId(event.GetInt("userid"));
    
int attacker GetClientOfUserId(event.GetInt("attacker"));

    if(!
attacker || attacker == victim || GetClientTeam(attacker) != GetClientTeam(victim)) return;

    
teamkill_counts[attacker]++;
    
PrintToChatAll("%N TEAMKILLED %N (%i/%i)."attackervictimteamkill_counts[attacker], sm_teamkill_limit.IntValue);

    if(
teamkill_counts[attacker] >= sm_teamkill_limit.IntValue && !IsClientInKickQueue(attacker))
    {
        
KickClient(attacker"Kicked for reaching the TeamKill limit.");
       
    }
    


Last edited by KALASH NICOLE; 05-09-2017 at 06:06.
KALASH NICOLE is offline
 


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


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