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(PLUGIN, VERSION, AUTHOR);
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) == 2 && g_shown_message[id] == 0)
{
fm_set_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 1);
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