Raised This Month: $ Target: $400
 0% 

[HELP] Rebel script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 01-21-2009 , 10:46   Re: [HELP] Rebel script
Reply With Quote #1

Use this.
Kills counter and rebels will be reset.
(Untested):
PHP Code:
#include <amxmodx>

new g_iTKills[33], g_iMaxPlayers;
new 
bool:g_bRebel[33];

public 
plugin_init()
{
    
register_event("DeathMsg""ev_Death""a");
    
register_event("Damage""ev_Damage""b");
    
register_event("HLTV""ev_newRound""a""1=0""2=0");
    
g_iMaxPlayers get_maxplayers();
}

public 
ev_Death()
{
    static 
iVic iVic read_data(2);
    static 
iAtt iAtt read_data(1);
    
    if(!(
<= iAtt <= g_iMaxPlayers)
    || !(
<= iVic <= g_iMaxPlayers))
    {
        return 
PLUGIN_CONTINUE;
    }
    
    static 
aName[32], vName[32];
    
    if(
get_user_team(iAtt) == 2)
    {
        
get_user_name(iAttaNamecharsmax(aName));
        
        if(
get_user_team(iVic) == && ++g_iTKills[iAtt] > 2)
        {
            
user_silentkill(iAtt);
            
client_print(0print_chat"[Rebel] CT Player ^"%s^" was slayed after killing more than 2 terrorists"aName);
            
g_iTKills[iAtt] = 0;
        }
        
    }
    
    if(
g_bRebel[iVic])
    {
        if(
aName[0])
        {
            
get_user_name(iVicvNamecharsmax(vName));
            
client_print(0print_chat"[Rebel] CT Player ^"%s^" killed rebel ^"%s^""aNamevName);
        }
        
g_bRebel[iVic] = false;
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
ev_Damage(iVic)
{
    static 
iAtt iAtt get_user_attacker(iVic);
    
    if(!(
<= iAtt <= g_iMaxPlayers))
    {
        return 
PLUGIN_CONTINUE;
    }
    
    static 
TName[32];
    
    if(
get_user_team(iVic) == && get_user_team(iAtt) == 1)
    {
        if(!
g_bRebel[iAtt])
        {
            
get_user_name(iAttTNamecharsmax(TName));
            
client_print(0print_chat"[Rebel] T Player ^"%s^" is a rebel!");
            
g_bRebel[iAtt] = true;
        }
    }
    
    return 
PLUGIN_CONTINUE;
}

public 
ev_newRound()
{
    for(new 
<= g_iMaxPlayers i++)
    {
        
g_bRebel[i] = false;
        
g_iTKills[i] = 0;
    }
}

public 
client_disconnect(id)
{
    
g_bRebel[id] = false;
    
g_iTKills[id] = 0;

__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ

Last edited by Dores; 01-22-2009 at 00:04.
Dores 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 01:43.


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