Raised This Month: $ Target: $400
 0% 

JailBreak Rebel System


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-03-2009 , 13:53   JailBreak Rebel System
Reply With Quote #1

I'm trying to make a PrisonBreak mod for 1.6 but am still fairly noob when it comes to scripting...

I want to make the rebel system that they have on source, so what happens is when a terrorist damages a counter-terrorist once, a message pops up saying they're a rebel and they turn red, until a new round begins. I compiled a small script that I knew wouldn't work but someone might be able to finish correctly... I got it to work to a degree but it kept on repeating the "%name% is now a rebel!" line over and over after the first hit.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta_util>
#include <colorchat>
#define PLUGIN "Rebel Detector"
#define VERSION "1.0"
#define AUTHOR "shadow.hk"
new g_shown_message[33];
public 
plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR);
 
register_event("Damage""damage_event""b"
 
register_event("HLTV""event_new_round""a");
}
public 
event_new_round(id,attacker)
{
 if(
get_user_team(id) == 1)
 {
  
g_shown_message[id] = 0;
  
fm_set_user_rendering(id,kRenderFxNone,255,255,255,kRenderNormal,16);
 }
}
public 
damage_event(id)
{
 if(
get_user_team(id) == && g_shown_message[id] == 0)
 {
  
fm_set_rendering(idkRenderFxGlowShell25500kRenderNormal1);
 
  new 
name[32];
  
get_user_name(id,name,31);
  
ColorChat(0,NORMAL,"[ ^x04PrisonBreak^x01 ] ^x04%s^x01 Is Now a Rebel!",name);
 
  
g_shown_message[id] = 1;
 }
 return 
HAM_HANDLED;

Any help would be greatly appreciated
shadow.hk is offline
Send a message via MSN to shadow.hk
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-03-2009 , 14:38   Re: JailBreak Rebel System
Reply With Quote #2

Try this:

. . .
__________________

Last edited by fysiks; 06-04-2009 at 01:52.
fysiks is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-03-2009 , 14:40   Re: JailBreak Rebel System
Reply With Quote #3

Quote:
Originally Posted by shadow.hk View Post
I'm trying to make a PrisonBreak mod for 1.6 but am still fairly noob when it comes to scripting...

I want to make the rebel system that they have on source, so what happens is when a terrorist damages a counter-terrorist once, a message pops up saying they're a rebel and they turn red, until a new round begins. I compiled a small script that I knew wouldn't work but someone might be able to finish correctly... I got it to work to a degree but it kept on repeating the "%name% is now a rebel!" line over and over after the first hit.

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta_util>
#include <colorchat>
#define PLUGIN "Rebel Detector"
#define VERSION "1.0"
#define AUTHOR "shadow.hk"
new g_shown_message[33];
public 
plugin_init()
{
 
register_plugin(PLUGINVERSIONAUTHOR);
 
register_event("Damage""damage_event""b"
 
register_event("HLTV""event_new_round""a");
}
public 
event_new_round(id,attacker)
{
 if(
get_user_team(id) == 1)
 {
  
g_shown_message[id] = 0;
  
fm_set_user_rendering(id,kRenderFxNone,255,255,255,kRenderNormal,16);
 }
}
public 
damage_event(id)
{
 if(
get_user_team(id) == && g_shown_message[id] == 0)
 {
  
fm_set_rendering(idkRenderFxGlowShell25500kRenderNormal1);
 
  new 
name[32];
  
get_user_name(id,name,31);
  
ColorChat(0,NORMAL,"[ ^x04PrisonBreak^x01 ] ^x04%s^x01 Is Now a Rebel!",name);
 
  
g_shown_message[id] = 1;
 }
 return 
HAM_HANDLED;

Any help would be greatly appreciated
Is
PHP Code:
get_user_name(idname31);
-->
name get_user_name(id
correct?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-03-2009 , 14:41   Re: JailBreak Rebel System
Reply With Quote #4

Quote:
Originally Posted by TitANious View Post
Is
PHP Code:
get_user_name(idname31);
-->
name get_user_name(id
correct?
NO. Not even close.
__________________
fysiks is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-03-2009 , 15:01   Re: JailBreak Rebel System
Reply With Quote #5

Sorry then..
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-03-2009 , 15:29   Re: JailBreak Rebel System
Reply With Quote #6

Didn't work

You had the wrong team, but i changed that round, but it's still displaying the message everytime I get damaged or hit a counter-terrorist. I only need it to show once, and only when i hit a ct.
shadow.hk is offline
Send a message via MSN to shadow.hk
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-03-2009 , 16:21   Re: JailBreak Rebel System
Reply With Quote #7

Quote:
Originally Posted by shadow.hk View Post
You had the wrong team
I didn't change anything having to to with teams.
__________________

Last edited by fysiks; 06-04-2009 at 01:51.
fysiks is offline
shadow.hk
Senior Member
Join Date: Dec 2008
Location: WA, Australia
Old 06-04-2009 , 00:33   Re: JailBreak Rebel System
Reply With Quote #8

Still doesn't work. Same issues as before, however, it doesn't say you're a rebel when damaging yourself anymore.

Problems...
Says you're a rebel on every startround (but resets your rendering to normal anyway)
Says you're a rebel EVERYtime you attack a ct
shadow.hk is offline
Send a message via MSN to shadow.hk
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 06-04-2009 , 00:40   Re: JailBreak Rebel System
Reply With Quote #9

Filter the damage event :

PHP Code:
register_event("Damage""Event_Damage""b""2>0""3=0")

public 
Event_DamageiVictim )
{
    if( 
read_data(4) || read_data(5) || read_data(6) )
    { 
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-04-2009 , 01:41   Re: JailBreak Rebel System
Reply With Quote #10

Quote:
Originally Posted by shadow.hk View Post
Says you're a rebel on every startround (but resets your rendering to normal anyway)
I don't know what this means. Please elaborate.

Added Connor's suggestion:

PHP Code:
#include <amxmodx>
#include <fun>
// #include <colorchat>

#define PLUGIN "Rebel Detector"
#define VERSION "1.0"
#define AUTHOR "shadow.hk"

new g_is_rebel[33]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("Damage""damage_event""b""2>0""3=0")
    
register_event("HLTV""event_new_round""a")
}

public 
client_connect(id)
{
    
g_is_rebel[id] = 0
}

public 
event_new_round()
{
    new 
iPlayers[32], iPlayersNum
    get_players
(iPlayersiPlayersNum)
    
    for( new 
0iPlayersNumi++ )
    {
        
g_is_rebel[iPlayers[i]] = 0
        set_user_rendering
(i)
    }
}

public 
damage_event(iVictim)
{
    new 
iAttacker get_user_attacker(iVictim)
    
    if( 
read_data(4) || read_data(5) || read_data(6) ) 
    {
        if( 
g_is_rebel[iAttacker] == && get_user_team(iAttacker) == && get_user_team(iVictim) == )
        {
            
set_user_rendering(iAttackerkRenderFxGlowShell25500kRenderNormal1)
            
            new 
name[32]
            
get_user_name(iAttacker,name,31)
            
// ColorChat(0,NORMAL,"[ ^x04PrisonBreak^x01 ] ^x04%s^x01 Is Now a Rebel!",name)
            
client_print(0print_chat"[ PrisonBreak ] %s Is Now a Rebel!"name)
            
            
g_is_rebel[iAttacker] = 1
        
}
    }
    return 
PLUGIN_HANDLED

If this doesn't fix it you will just have to debug it.
__________________

Last edited by fysiks; 06-04-2009 at 01:54.
fysiks 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 14:02.


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