Elemental AWP
Tiros que Congelam e Queimam
* Creditos ao [P]erfec[T][S]cr[@]s[H]
Sma:
- Código:
/*===============================================================================
[Includes]
=================================================================================*/
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <zombie_plague_advance>
#include <fakemeta>
#include <cstrike>
#include <engine>
#include < fun >
/*===============================================================================
[IDs, Defines & Cvars]
=================================================================================*/
new gc_itemID
new bool:g_ElementalFrost[33]
new g_FrozeN[33]
new ElementalFrostSpr
new g_msgScreenFade
new bullets[ 33 ]
new g_hasZoom[ 33 ]
new m_spriteTexture
new g_MaxPlayers
#define IsValidUser(%1) (1 <= %1 <= g_MaxPlayers)
#define ENG_NULLENT -1
#define EV_INT_WEAPONKEY EV_INT_impulse
#define WEAPONKEY 324584
#define ITEM_COST 100
new const g_Ent[] = "weapon_awp"
const UNIT_SECOND = (1<<12)
// ZP default Burn sounds
new const burn_sounds[ ][ ] =
{
"zombie_plague/zombie_burn3.wav",
"zombie_plague/zombie_burn4.wav",
"zombie_plague/zombie_burn5.wav",
"zombie_plague/zombie_burn6.wav",
"zombie_plague/zombie_burn7.wav"
}
new EL_V_MODEL[64] = "models/zombie_plague/v_awpfire.mdl"
new EL_P_MODEL[64] = "models/zombie_plague/p_awpfire.mdl"
new EL_W_MODEL[64] = "models/zombie_plague/w_awpfire.mdl"
new EL_OLD_W_MODEL[64] = "models/w_awp.mdl"
// Item ID, Flame Sprite, Smoke sprite
new sprFlame, sprSmoke
// Some bools
new bool:g_ElementalFire[ 33 ]
new bool:g_AlreadyBurn[ 33 ]
// Cvars
new cvar_frosttime, cvar_back_speed1, cvar_back_speed2, cvar_dmgmultiplier
new cvar_MaxBurnDMG, cvar_MinBurnDMG, cvar_BurnTime, cvar_Delay, cvar_MinHealth
new cvar_cMaxBurnDMG, cvar_cMinBurnDMG, cvar_cBurnTime, Float:cvar_cDelay, cvar_cMinHealth, cvar_custommodel, cvar_uclip, cvar_tracer, cvar_oneround
new Time[ 33 ]
/*===============================================================================
[Registro do Plugin]
=================================================================================*/
public plugin_init()
{
// Registro do Plugin
register_plugin("[ZP] Extra Item: Elemental AWP", "1.0", "Catastrophe | TNT")
// Registro de Cvars
cvar_dmgmultiplier = register_cvar("zp_elemental_awp_dmg_multiplier", "5") // Dano da Elemental
cvar_custommodel = register_cvar("zp_elemental_awp_custom_model", "1") // Model Personalizado (0 - Desligado | 1 - Ligado)
cvar_uclip = register_cvar("zp_elemental_awp_unlimited_clip", "1") // Bala Infinita (0 - Desligado | 1 - Ligado)
cvar_tracer = register_cvar("zp_elemental_awp_tracers", "1") // Rastro da Bala (0 - Desligado | 1 - Ligado)
cvar_frosttime = register_cvar("zp_elemental_awp_frost_time", "1.500") // Tempo que ira ficar congelado
cvar_back_speed1 = register_cvar("zp_elemental_awp_back_spd_h", "300.0") // Velocidade que ficara depois de descongelar
cvar_back_speed2 = register_cvar("zp_elemental_awp_back_spd_z", "300.0")
cvar_MaxBurnDMG = register_cvar("zp_elemental_awp_fire_maxdmg", "40") // Dano Do fogo (Quando queima o zm)
cvar_MinBurnDMG = register_cvar("zp_elemental_awp_fire_mindmg", "40")
cvar_BurnTime = register_cvar("zp_elemental_awp_fire_time", "12") // Tempo que ira ficar queimando
cvar_Delay = register_cvar("zp_elemental_awp_delay", "4.0") // Sei-la o que eh isso
cvar_MinHealth = register_cvar("zp_elemental_awp_fire_minhp", "50") // Quantidade minima de HP para o Zombie Queimar
cvar_oneround = register_cvar("zp_elemental_awp_one_round", "1") // A Elemental deve ficar 1 round? (1 - Sim | 0 - Não)
g_MaxPlayers = get_maxplayers()
g_msgScreenFade = get_user_msgid("ScreenFade")
// Registro do Item
gc_itemID = zp_register_extra_item("Elemental AWP \dEXT", ITEM_COST, ZP_TEAM_HUMAN)
// Eventos
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("CurWeapon", "event_CurWeapon", "b", "1=1")
register_event("CurWeapon","checkWeapon","be","1=1")
register_event("CurWeapon", "make_tracer", "be", "1=1", "3>0")
// Forwards
register_forward(FM_PlayerPreThink, "fw_PlayerPreThink")
register_forward( FM_CmdStart, "fw_CmdStart" )
register_forward(FM_SetModel, "fw_SetModel")
// Hams
RegisterHam( Ham_Spawn, "player", "fw_PlayerSpawn_Post", 1 )
RegisterHam( Ham_Killed, "player", "fw_PlayerKilled_Post", 1 )
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHam(Ham_TakeDamage, "player", "dmg_check")
RegisterHam(Ham_Item_AddToPlayer, g_Ent, "fw_AddToPlayer")
}
/*===============================================================================
[O Bang que Carregara as Cvars]
=================================================================================*/
public plugin_cfg()
{
new cfgdirecction[32]
get_configsdir(cfgdirecction, sizeof cfgdirecction - 1);
server_cmd("exec %s/zp_elemental_awp.cfg", cfgdirecction)
}
/*===============================================================================
[Precaches]
=================================================================================*/
public plugin_precache()
{
// Models
precache_model(EL_V_MODEL)
precache_model(EL_P_MODEL)
precache_model(EL_W_MODEL)
precache_model(EL_OLD_W_MODEL)
// Sounds
precache_sound("warcraft3/impalehit.wav");
// Sprite do Rastro
m_spriteTexture = precache_model("sprites/dot.spr")
precache_sound("weapons/zoom.wav")
// Sprite do Gelo
ElementalFrostSpr = precache_model("sprites/shockwave.spr");
// Sprite do Fogo
sprFlame = precache_model( "sprites/flame.spr" )
sprSmoke = precache_model( "sprites/black_smoke3.spr" )
// Som dos ZMs Queimando
for( new i = 0; i < sizeof burn_sounds; i++ )
precache_sound( burn_sounds[ i ] )
}
/*===============================================================================
[Prevenção de Bugs]
=================================================================================*/
public event_round_start()
{
if(get_pcvar_num(cvar_oneround))
{
for (new i = 1; i <= g_MaxPlayers; i++)
{
if (!is_user_connected(i))
continue
if (g_ElementalFrost[i])
{
g_ElementalFrost[i] = false
}
if (g_ElementalFire[i])
{
g_ElementalFire[i] = false
}
if(g_FrozeN[i])
{
g_FrozeN[i] = false
}
}
}
{
cvar_cMaxBurnDMG = get_pcvar_num( cvar_MaxBurnDMG )
cvar_cMinBurnDMG = get_pcvar_num( cvar_MinBurnDMG )
cvar_cBurnTime = get_pcvar_num( cvar_BurnTime )
cvar_cDelay = get_pcvar_float( cvar_Delay )
cvar_cMinHealth = get_pcvar_num( cvar_MinHealth )
}
}
public fw_PlayerKilled_Post( victim, attacker, shouldgib )
{
if(g_FrozeN[victim] )
g_FrozeN[victim] = false
}
public fw_PlayerSpawn_Post( victim, attacker, shouldgib )
{
if(g_FrozeN[victim] )
g_FrozeN[victim] = false
}
public client_putinserver(id)
{
g_ElementalFrost[id] = false
g_ElementalFire[id] = false
g_FrozeN[id] = false
}
public client_disconnect(id)
{
g_ElementalFrost[id] = false
g_ElementalFire[id] = false
g_FrozeN[id] = false
}
public client_connect(id)
{
g_ElementalFrost[id] = false
g_ElementalFire[id] = false
g_FrozeN[id] = false
}
public zp_user_humanized_post(id, human)
{
g_ElementalFrost[id] = false
g_ElementalFire[id] = false
g_FrozeN[id] = false
}
public zp_user_humanized_pre(id)
{
g_ElementalFrost[id] = false
g_ElementalFire[id] = false
g_FrozeN[id] = false
}
public zp_user_infected_post(id, infected, infector)
{
g_ElementalFrost[id] = false
g_ElementalFire[id] = false
g_FrozeN[id] = false
}
public zp_user_infected_pre(id, infected, infector)
{
g_ElementalFrost[id] = false
g_ElementalFire[id] = false
g_FrozeN[id] = false
}
/*===============================================================================
[Ações ao Escolher o Item]
=================================================================================*/
public zp_extra_item_selected(player, itemid)
{
// check if the selected item matches any of our registered ones
if (itemid == gc_itemID)
{
if(g_ElementalFire[player] && g_ElementalFrost[player])
{
client_printcolor(player, "/g[ZP]/y Voce ja tem a Elemental")
zp_set_user_ammo_packs(player, zp_get_user_ammo_packs(player) + ITEM_COST)
return;
}
if (!zp_has_round_started())
{
client_printcolor(player, "/g[ZP]/y Espere o round comecar...", player)
zp_set_user_ammo_packs(player, zp_get_user_ammo_packs(player) + ITEM_COST)
return;
}
else
{
g_ElementalFrost[player] = true
g_ElementalFire[player] = true
client_printcolor(player,"/g[ZP]/y Voce Comprou a /tElemental AWP ")
give_item(player, "weapon_awp")
}
}
}
/*===============================================================================
[O Bang que ira acionar o comando para queimar e congelar]
=================================================================================*/
public fw_TakeDamage(victim, inflictor, attacker, Float:damage, damage_type)
{
switch(random_num(0,100))
{
// O Bang que fara o ZM congelar
case 0..30:
{
if(!is_user_connected(attacker) || !is_user_connected(victim) || zp_get_user_nemesis(victim) || zp_get_user_assassin(victim) || attacker == victim || !attacker)
return HAM_IGNORED
// For Frost Effect Ring
static Float:originF[3]
pev(victim, pev_origin, originF)
// For Frost Effect Sound
static originF2[3]
get_user_origin(victim, originF2)
if (g_ElementalFrost[attacker] && get_user_weapon(attacker) == CSW_AWP)
{
FrostEffect(victim)
FrostEffectRing(originF)
FrostEffectSound(originF2)
}
else
{
if(zp_get_user_nemesis(victim) || zp_get_user_assassin(victim))
{
client_print(attacker, print_center, "[Elemental AWP] Nemesis e Assassino sao imunes ao Gelo")
return HAM_IGNORED
}
return PLUGIN_HANDLED;
}
}
// O Bang que fara o ZM pegar fogo
case 31..100:
{
if( IsValidUser( attacker ) && victim != attacker && zp_get_user_zombie( victim )
&& g_ElementalFire[ attacker ] && get_user_weapon( attacker ) == CSW_AWP && !g_AlreadyBurn[ victim ] && get_user_health( victim ) > cvar_cMinHealth )
{
// Efeito da Aura
static Float:originF[3]
pev(victim, pev_origin, originF)
// Burn / ON
g_AlreadyBurn[ victim ] = true
// Set burn time
Time[ victim ] = cvar_cBurnTime
// Burn victim
Burn( victim )
// Efeito da Aura
FireAuraEffect(originF)
// Emit burn sound
emit_sound( victim, CHAN_VOICE, burn_sounds[random_num(0, sizeof burn_sounds - 1)], 1.0, ATTN_NORM, 0, PITCH_NORM )
}
}
}
return PLUGIN_CONTINUE
}
/*===============================================================================
[O Bang que ira multiplicar o DMG da Elemental]
=================================================================================*/
public dmg_check(victim, inflictor, attacker, Float:damage)
{
if (IsValidUser(attacker) && get_user_weapon(attacker) == CSW_AWP && g_ElementalFrost[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_dmgmultiplier ))
}
}
/*===============================================================================
[O Bang que fara a model aparecer]
=================================================================================*/
public event_CurWeapon(id)
{
if ( zp_get_user_zombie(id) )
return PLUGIN_HANDLED
new g_Weapon = read_data(2)
if ( g_Weapon == CSW_AWP && g_ElementalFrost[id] == true && get_pcvar_num(cvar_custommodel) )
{
set_pev(id, pev_viewmodel2, EL_V_MODEL)
set_pev(id, pev_weaponmodel2, EL_P_MODEL)
}
return PLUGIN_CONTINUE
}
/*===============================================================================
[O Bang que Fara Ter a Bala Infinita]
=================================================================================*/
public checkWeapon(id)
{
new plrClip, plrAmmo, plrWeap[32]
new plrWeapId
plrWeapId = get_user_weapon(id, plrClip , plrAmmo)
if (plrWeapId == CSW_AWP && g_ElementalFrost[id] && g_ElementalFire[id])
{
event_CurWeapon(id)
}
else
{
return PLUGIN_CONTINUE
}
if (plrClip == 0 && get_pcvar_num(cvar_uclip))
{
// If the user is out of ammo..
get_weaponname(plrWeapId, plrWeap, 31)
// Get the name of their weapon
give_item(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
engclient_cmd(id, plrWeap)
}
return PLUGIN_HANDLED
}
/*===============================================================================
[O Rastro da Arma]
=================================================================================*/
public make_tracer(id)
{
if (get_pcvar_num(cvar_tracer))
{
new clip,ammo
new wpnid = get_user_weapon(id,clip,ammo)
new pteam[16]
get_user_team(id, pteam, 15)
if ((bullets[id] > clip) && (wpnid == CSW_AWP) && g_ElementalFrost[id] && g_ElementalFire[id])
{
new vec1[3], vec2[3]
get_user_origin(id, vec1, 1) // origin; your camera point.
get_user_origin(id, vec2, 4) // termina; where your bullet goes (4 is cs-only)
switch(random_num(1, 100))
{
case 1..30 :
{
//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (0) //TE_BEAMENTPOINTS 0
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( m_spriteTexture )
write_byte(1) // framestart
write_byte(5) // framerate
write_byte(2) // life
write_byte(10) // width
write_byte(0) // noise
write_byte( 0 ) // r, g, b
write_byte( 255) // r, g, b
write_byte( 255 ) // r, g, b
write_byte(200) // brightness
write_byte(150) // speed
message_end()
}
case 31..100 :
{
//BEAMENTPOINTS
message_begin( MSG_BROADCAST,SVC_TEMPENTITY)
write_byte (0) //TE_BEAMENTPOINTS 0
write_coord(vec1[0])
write_coord(vec1[1])
write_coord(vec1[2])
write_coord(vec2[0])
write_coord(vec2[1])
write_coord(vec2[2])
write_short( m_spriteTexture )
write_byte(1) // framestart
write_byte(5) // framerate
write_byte(2) // life
write_byte(10) // width
write_byte(0) // noise
write_byte( 255 ) // r, g, b
write_byte( 69 ) // r, g, b
write_byte( 0 ) // r, g, b
write_byte(200) // brightness
write_byte(150) // speed
message_end()
}
}
}
bullets[id] = clip
}
}
/*===============================================================================
[World Model]
=================================================================================*/
public fw_SetModel(entity, model[])
{
if(!is_valid_ent(entity))
return FMRES_IGNORED;
if(!equal(model, EL_OLD_W_MODEL))
return FMRES_IGNORED;
static szClassName[33]
entity_get_string(entity, EV_SZ_classname, szClassName, charsmax(szClassName))
if(!equal(szClassName, "weaponbox"))
return FMRES_IGNORED
static iOwner, iStoredGalilID
iOwner = entity_get_edict(entity, EV_ENT_owner)
iStoredGalilID = find_ent_by_owner(ENG_NULLENT, g_Ent, entity)
if(g_ElementalFrost[iOwner] && g_ElementalFire[iOwner] && is_valid_ent(iStoredGalilID))
{
g_ElementalFrost[iOwner] = false
g_ElementalFire[iOwner] = false
entity_set_int(iStoredGalilID, EV_INT_WEAPONKEY, WEAPONKEY)
entity_set_model(entity, EL_W_MODEL)
return FMRES_SUPERCEDE
}
return FMRES_IGNORED
}
public fw_AddToPlayer(AWP, id)
{
if(is_valid_ent(AWP) && is_user_connected(id) && entity_get_int(AWP, EV_INT_WEAPONKEY) == WEAPONKEY)
{
g_ElementalFire[id] = true
g_ElementalFrost[id] = true
entity_set_int(AWP, EV_INT_WEAPONKEY, 0)
return HAM_HANDLED
}
return HAM_IGNORED
}
/*===============================================================================
[O Bang que ira congelar + os efeitos]
=================================================================================*/
public fw_PlayerPreThink(id)
{
// Not alive
if (!is_user_alive(id))
return;
// Set Player MaxSpeed
if (g_FrozeN[id])
{
set_pev(id, pev_velocity, Float:{0.0,0.0,0.0}) // stop motion
set_pev(id, pev_maxspeed, 1.0) // prevent from moving
}
else
{
if(!zp_get_user_zombie(id))
{
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_back_speed1)) // Change this in Cvar if you Want
}
else
{
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_back_speed2)) // Change this in Cvar if you Want
}
}
}
// Frost Effect
public FrostEffect(id)
{
// Only effect alive unfrozen zombies
if (!is_user_alive(id) || !zp_get_user_zombie(id) || g_FrozeN[id])
return;
message_begin(MSG_ONE_UNRELIABLE, g_msgScreenFade, _, id)
write_short(UNIT_SECOND*1) // duration
write_short(UNIT_SECOND*1) // hold time
write_short(0x0000) // fade type
write_byte(0) // red
write_byte(50) // green
write_byte(200) // blue
write_byte(100) // alpha
message_end()
// Light blue glow while frozen
#if defined HANDLE_MODELS_ON_SEPARATE_ENT
fm_set_rendering(g_ent_playermodel[id], kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25)
#else
fm_set_rendering(id, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 25)
#endif
g_FrozeN[id] = true
set_task(get_pcvar_float(cvar_frosttime), "RemoveFrost", id) // Time to Remove Frost Effect
}
// Frost Effect Sound
public FrostEffectSound(iOrigin[3])
{
new Entity = create_entity("info_target")
new Float:flOrigin[3]
IVecFVec(iOrigin, flOrigin)
entity_set_origin(Entity, flOrigin)
emit_sound(Entity, CHAN_WEAPON, "warcraft3/impalehit.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
remove_entity(Entity)
}
// Frost Effect Ring
FrostEffectRing(const Float:originF3[3])
{
// Largest ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF3, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF3[0]) // x
engfunc(EngFunc_WriteCoord, originF3[1]) // y
engfunc(EngFunc_WriteCoord, originF3[2]) // z
engfunc(EngFunc_WriteCoord, originF3[0]) // x axis
engfunc(EngFunc_WriteCoord, originF3[1]) // y axis
engfunc(EngFunc_WriteCoord, originF3[2]+100.0) // z axis
write_short(ElementalFrostSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(41) // red
write_byte(138) // green
write_byte(255) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()
// Efeito da Aura
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF3, 0)
write_byte(TE_DLIGHT) // TE id
engfunc(EngFunc_WriteCoord, originF3[0]) // x
engfunc(EngFunc_WriteCoord, originF3[1]) // y
engfunc(EngFunc_WriteCoord, originF3[2]) // z
write_byte(50) // radio
write_byte(000) // r
write_byte(255) // g
write_byte(255) // b
write_byte(30) // vida en 0.1, 30 = 3 segundos
write_byte(30) // velocidad de decaimiento
message_end()
}
// Remove Frost Effect
public RemoveFrost(id)
{
// Not alive or not frozen anymore
if (!is_user_alive(id) || !g_FrozeN[id])
return;
// Unfreeze
g_FrozeN[id] = false;
// Remove glow
#if defined HANDLE_MODELS_ON_SEPARATE_ENT
fm_set_rendering(g_ent_playermodel[id])
#else
fm_set_rendering(id)
#endif
}
FireAuraEffect(const Float:originF3[3])
{
// Efeito da Aura
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF3, 0)
write_byte(TE_DLIGHT) // TE id
engfunc(EngFunc_WriteCoord, originF3[0]) // x
engfunc(EngFunc_WriteCoord, originF3[1]) // y
engfunc(EngFunc_WriteCoord, originF3[2]) // z
write_byte(50) // radio
write_byte(255) // r
write_byte(69) // g
write_byte(000) // b
write_byte(30) // vida en 0.1, 30 = 3 segundos
write_byte(30) // velocidad de decaimiento
message_end()
}
/*===============================================================================
[O Bang que ira fazer queimar]
=================================================================================*/
public Burn( victim )
{
// Get user origin
static Origin[ 3 ] ; get_user_origin( victim, Origin )
// If burn time is over or victim are in water
if( Time[ victim ] <= 0 || get_entity_flags( victim ) & FL_INWATER )
{
// Show Smoke sprite
message_begin( MSG_PVS, SVC_TEMPENTITY, Origin )
write_byte( TE_SMOKE ) // TE id
write_coord( Origin[0] ) // x
write_coord( Origin[1] ) // y
write_coord( Origin[2]-50 ) // z
write_short( sprSmoke ) // sprite
write_byte( random_num(15, 20) ) // scale
write_byte( random_num(10, 20) ) // framerate
message_end( )
// Delay to allow burn again
set_task( cvar_cDelay, "Stop", victim )
// Exit
return
}
else
{
if( cvar_cBurnTime / 2 == Time[ victim ] ) // At half-burntime
{
// Play another sound
emit_sound( victim, CHAN_VOICE, burn_sounds[ random_num( 0, charsmax( burn_sounds ) ) ], 1.0, ATTN_NORM, 0, PITCH_NORM )
}
// Flame sprite
message_begin( MSG_PVS, SVC_TEMPENTITY, Origin )
write_byte( TE_SPRITE ) // TE id
write_coord( Origin[0]+random_num(-5, 5) ) // x
write_coord( Origin[1]+random_num(-5, 5) ) // y
write_coord( Origin[2]+random_num(-10, 10) ) // z
write_short( sprFlame ) // sprite
write_byte( random_num(5, 10) ) // scale
write_byte( 200 ) // brightness
message_end( )
// Decrease Time
Time[ victim ]--
// Decrease life (random)
set_user_health( victim, get_user_health( victim ) - random_num( cvar_cMinBurnDMG, cvar_cMaxBurnDMG ) )
// Stop fire if health <= min health.
if( get_user_health( victim ) <= cvar_cMinHealth )
{
g_AlreadyBurn[ victim ] = false
return
}
// Repeat
set_task( 0.5, "Burn", victim )
}
}
public Stop( victim )
{
g_AlreadyBurn[ victim ] = false // Allow burn again
}
/*===============================================================================
[Stocks]
=================================================================================*/
// O Bang que dara o Glow sem a include fakemeta_util
stock fm_set_rendering(entity, fx = kRenderFxNone, r = 255, g = 255, b = 255, render = kRenderNormal, amount = 16)
{
static Float:color[3]
color[0] = float(r)
color[1] = float(g)
color[2] = float(b)
set_pev(entity, pev_renderfx, fx)
set_pev(entity, pev_rendercolor, color)
set_pev(entity, pev_rendermode, render)
set_pev(entity, pev_renderamt, float(amount))
}
// Mensagem colorida (client_printcolor)
stock client_printcolor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "/g", "^4") // Chat Verde
replace_all(msg, 190, "/y", "^1") // Chat Normal
replace_all(msg, 190, "/t", "^3") // Chat Do Time Tr=Vermelho Ct=Azul Spec=Branco
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
Última edição por MasterUnltd em 28/12/2013, 11:16 am, editado 1 vez(es)