Есть исходник плагина teamflash_punish (за ослепление своих слеп). Помогите переделать так, чтоб появляющееся сообщение мерцало(типо как в HLGuard когда банит, слева мигает ник игрока, ну и за что забанен). Ну или хотябы, чтоб было зеленым цветом.... Читал как переделать цвет, сделал, всеравно стандартного цвета почему то.... вобщем нужна ваша помошь...
Цитата
#include <amxmodx>
#include <fakemeta>
#define MAX_PLAYERS 32
#define OFFSET_TEAM 114
#define W_FLASH_MODEL_STRLEN 22
#define FLASH_XPLODE_SOUND_STRLEN 23
new g_iMaxClients
new g_iHasJustBeenFlashed[MAX_PLAYERS+1]
new g_iFlashTeamCount[MAX_PLAYERS+1]
new g_pcvarTeamFlash, g_pcvarMax, g_pcvarSlap, g_pcvarPunish
public plugin_init()
{
register_plugin("Team Flash Punish", "1.0.1", "ConnorMcLeod")
g_pcvarTeamFlash = register_cvar("tfp_count", "1") // 0: don't count, 1:count only fully blinded, 2:count all flash
g_pcvarMax = register_cvar("tfp_max_count", "10") // disallow flashbang after X count
g_pcvarPunish = register_cvar("tfp_slap", "1") // 0: don't slap, 1:slap only fully blinded, 2:slap all flash
g_pcvarSlap = register_cvar("tfp_slap_amount", "0") // slap powaaaa
register_event("ScreenFade", "Event_ScreenFade", "be", "4=255", "5=255", "6=255", "7=200", "7=255")
register_forward(FM_SetModel, "Forward_SetModel")
register_forward(FM_EmitSound, "Forward_EmitSound")
}
public plugin_cfg()
{
g_iMaxClients = global_get(glb_maxClients)
}
public Forward_SetModel(iEntity, const szModel[])
{
if(strlen(szModel) != W_FLASH_MODEL_STRLEN)
{
return FMRES_IGNORED
}
if(szModel[7] != 'w' || szModel[9] != 'f' || szModel[14] != 'b')
{
return FMRES_IGNORED
}
if(!pev_valid(iEntity))
{
return FMRES_IGNORED
}
static Float:fVelocity[3]
pev(iEntity, pev_velocity, fVelocity)
if(!fVelocity[0] && !fVelocity[1] && !fVelocity[2])
{
return FMRES_IGNORED
}
static iOwner, iMax
iOwner = pev(iEntity, pev_owner)
iMax = get_pcvar_num(g_pcvarMax)
if(iMax && g_iFlashTeamCount[iOwner] >= iMax)
{
engfunc(EngFunc_RemoveEntity, iEntity)
client_print(iOwner, print_center, "^x03Тебе запрещено использовать гранату flash, пока не научишься ее кидать.")
return FMRES_SUPERCEDE
}
set_pev(iEntity, pev_iuser4, iOwner)
return FMRES_HANDLED
}
public Forward_EmitSound(iEntity, iChannel, const szSample[])
{
if(strlen(szSample) != FLASH_XPLODE_SOUND_STRLEN)
{
return FMRES_IGNORED
}
if(szSample[0] != 'w' || szSample[8] != 'f' || szSample[9] != 'l')
{
return FMRES_IGNORED
}
if(!pev_valid(iEntity))
{
return FMRES_IGNORED
}
static iFlasher
iFlasher = pev(iEntity, pev_iuser4)
if(pev_valid(iFlasher) != 2)
return FMRES_IGNORED
static iCount, iPunish
iCount = get_pcvar_num(g_pcvarTeamFlash)
iPunish = get_pcvar_num(g_pcvarPunish)
if(!iCount && !iPunish)
{
return FMRES_HANDLED
}
static iTeam, id, iFlashed
iTeam = get_pdata_int(iFlasher, OFFSET_TEAM)
for(id=1; id<=g_iMaxClients; id++)
{
iFlashed = g_iHasJustBeenFlashed[id]
if(!iFlashed)
continue
g_iHasJustBeenFlashed[id] = 0
if(pev_valid(id) != 2)
continue
if(id != iFlasher && get_pdata_int(id, OFFSET_TEAM) == iTeam)
{
if( iCount && (iCount==2 || iFlashed==255) )
{
g_iFlashTeamCount[iFlasher]++
}
if( iPunish && (iPunish==2 || iFlashed==255) )
{
user_slap(iFlasher, get_pcvar_num(g_pcvarSlap), 0)
}
client_print(iFlasher, print_center, "^x01Научись кидать гранату flash! НЕ слепи своих!")
}
}
return FMRES_HANDLED
}
public Event_ScreenFade(id)
{
g_iHasJustBeenFlashed[id] = read_data(7)
}
public client_putinserver(id)
{
g_iFlashTeamCount[id] = 0
g_iHasJustBeenFlashed[id] = 0
}