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_Post( id )
{
if( is_user_alive( id ) )
{
g_bRebel[id] = false
g_iTKills[id] = 0
}
}
public Event_DeathMsg()
{
new iVictim = read_data(2)
if( cs_get_user_team( iVictim ) == CS_TEAM_T )
{
new iKiller = read_data(1)
if( IsPlayer( iKiller ) && cs_get_user_team( iKiller ) == CS_TEAM_CT )
{
if( g_bRebel[iVictim] )
{
new szVName[32], szKName[32]
get_user_name(iVictim, szVName, charsmax(szVName))
get_user_name(iKiller, szKName, charsmax(szKName))
client_print_c(0, "[JailBreak] ^1Guard ^4^"%s^"^1 killed rebel ^4^"%s^"", szKName, szVName)
}
else if( ++g_iTKills[iKiller] > 2 )
{
new szKName[32]
get_user_name(iKiller, szKName, charsmax(szKName))
user_silentkill( iKiller )
client_print_c(0, "[JailBreak] ^1Guard ^4^"%s^"^1 was slayed after killing more than 2 ^4prisoners", szKName)
}
}
}
}
public Event_Damage( id )
{
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(iAttacker, szName, charsmax(szName))
g_bRebel[iAttacker] = true
client_print_c(0, "[JailBreak] ^1Prisoner ^4^"%s^" ^1is a ^4rebel!", szName)
}
}
}
client_print_c(id, fmt[], any:...)
{
new szString[128]
szString[0] = 4
vformat(szString[1], sizeof( szString ) - 2, fmt, 3)
message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, gmsgSayText, _, id)
write_byte(1)
write_string(szString)
message_end()
}
__________________