AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Rebel System Color Help (https://forums.alliedmods.net/showthread.php?t=98426)

NzGamers 07-25-2009 09:28

Rebel System Color Help
 
Hi
I got the rebel system. I need some bits to be green. Could someone help me make the bits bold green. So say that ingame i shoot someone it ill say [JailBreak] John has shoot a prisoner. the [JailBreak] Must be green. Ill make the bits bold on the place i want green. ^"%s^" is the name of the person i also want the name of the person green. I want this plugin to complete ASAP thanks

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"[B][JailBreak][/B] Guard [B]^"%s^"[/B] was slayed after killing more than 2 [B]prisoners[/B]"aName);
            
g_iTKills[iAtt] = 0;
        }
        
    }
    
    if(
g_bRebel[iVic])
    {
        if(
aName[0])
        {
            
get_user_name(iVicvNamecharsmax(vName));
            
client_print(0print_chat"[B][JailBreak][/B] Guard [B]^"%s^"[/B] killed rebel [B]^"%s^""[/B], 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"[B][JailBreak][/B] Prisoner [B]^"%s^"[/B] is a [B]rebel![/B]"TName);
            
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;


THANK YOU I WANT THIS TO COMPLETE ASAP

NzGamers 07-25-2009 09:37

Re: Rebel System Color Help
 
+ karma

ConnorMcLeod 07-26-2009 07:11

Re: Rebel System Color Help
 
Try this (alsmot rewritten all plugin)

PHP Code:

/*    Formatright © 2009, ConnorMcLeod

    Jail Rebel is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Jail Rebel; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
*/

#include <amxmodx>
#include <cstrike>
#include <hamsandwich>

#define VERSION "0.0.2"

#define MAX_PLAYERS    32
#define IsPlayer(%1)    ( 1 <= %1 <= g_iMaxPlayers )

new g_iTKills[MAX_PLAYERS+1]
new 
g_bRebel[MAX_PLAYERS+1]

new 
g_iMaxPlayers
new gmsgSayText

public plugin_init()
{
    
register_plugin("Jail Rebel"VERSION"ConnorMcLeod")

    
RegisterHam(Ham_Spawn"player""Player_Spawn_Post"1)

    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_event("Damage""Event_Damage""b""2>0""3=0")

    
g_iMaxPlayers get_maxplayers()
    
gmsgSayText get_user_msgid("SayText")
}

public 
client_putinserver(id)
{
    
g_bRebel[id] = false
    g_iTKills
[id] = 0
}

public 
Player_Spawn_Postid )
{
    if( 
is_user_aliveid ) )
    {
        
g_bRebel[id] = false
        g_iTKills
[id] = 0
    
}
}

public 
Event_DeathMsg()
{
    new 
iVictim read_data(2)
    if( 
cs_get_user_teamiVictim ) == CS_TEAM_T )
    {
        new 
iKiller read_data(1)
        if( 
IsPlayeriKiller ) && cs_get_user_teamiKiller ) == CS_TEAM_CT )
        {
            if( 
g_bRebel[iVictim] )
            {
                new 
szVName[32], szKName[32]
                
get_user_name(iVictimszVNamecharsmax(szVName))
                
get_user_name(iKillerszKNamecharsmax(szKName))
                
client_print_c(0"[JailBreak] ^1Guard ^4^"%s^"^1 killed rebel ^4^"%s^""szKNameszVName)
            }
            else if( ++
g_iTKills[iKiller] > )
            {
                new 
szKName[32]
                
get_user_name(iKillerszKNamecharsmax(szKName))
                
user_silentkilliKiller )
                
client_print_c(0"[JailBreak] ^1Guard ^4^"%s^"^1 was slayed after killing more than 2 ^4prisoners"szKName)
            }
        }
    }
}

public 
Event_Damageid )
{
    if( (
read_data(4) || read_data(5) || read_data(6)) && cs_get_user_team(id) == CS_TEAM_CT )
    {
        new 
iAttacker get_user_attacker(id)
        if(    
IsPlayer(iAttacker)
        &&    !
g_bRebel[iAttacker]
        &&    
is_user_alive(iAttacker)
        &&    
cs_get_user_team(iAttacker) == CS_TEAM_T    )
        {
            new 
szName[32]
            
get_user_name(iAttackerszNamecharsmax(szName))
            
g_bRebel[iAttacker] = true
            client_print_c
(0"[JailBreak] ^1Prisoner ^4^"%s^" ^1is a ^4rebel!"szName)
        }
    }
}

client_print_c(idfmt[], any:...)
{
    new 
szString[128]
    
szString[0] = 4

    vformat
(szString[1], sizeofszString ) - 2fmt3)

    
message_begin(id MSG_ONE_UNRELIABLE MSG_BROADCASTgmsgSayText_id)
    
write_byte(1)
    
write_string(szString)
    
message_end()



NzGamers 07-27-2009 21:26

Re: Rebel System Color Help
 
Thank You Connor

shuttle_wave 10-23-2009 05:01

Re: Rebel System Color Help
 
nice +karma


All times are GMT -4. The time now is 18:28.

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