Pra quem queria botar pra lasermine ficar atravessavel, mostrar nome de quem planta e impedir com que outros quebrem sua lasermine sem ser zm/de outro time ai esta um plugin aqui abaixo:
- Código:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>
//#define FORFUN
#if defined FORFUN
#include <cstrike>
#else
#include <zombieplague>
#endif
#define PLUGIN "[ZP] Addon: Algumas coisas da minha lasermine para Lasermine normal"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H]"
#define lasermine_class "lasermine"
#define LASERMINE_OWNER pev_iuser2
new cvar_solid, cvar_breakable, cvar_show_status
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_show_status = register_cvar("zp_ltm_show_status", "1");
cvar_solid = register_cvar("zp_ltm_solid", "0");
cvar_breakable = register_cvar("zp_ltm_breakable_block", "1");
register_forward(FM_Touch, "ltm_touch") // Deixar Atravessavel
RegisterHam(Ham_TakeDamage, "func_breakable", "ltm_takedamage")
}
/*------------------------------------------------------------------------------------
[Esquema de Deixar a Lasermine Atravessavel]
-------------------------------------------------------------------------------------*/
public ltm_Touch(toucher, touched)
{
if(!is_user_alive(toucher) || !pev_valid(touched) || get_pcvar_num(cvar_solid)) return FMRES_IGNORED;
new classname[32]; pev(touched, pev_classname, classname, 31)
if(equal(classname, lasermine_class))
{
set_pev(touched, pev_solid, SOLID_NOT)
set_task(1.0, "solid_again", touched)
}
return FMRES_IGNORED
}
// Voltar ao Estado Solido
public solid_again(i_Ent)
{
if(!pev_valid(i_Ent)) return FMRES_IGNORED; // Evitar Erro de Log
new classname[32]; pev(i_Ent, pev_classname, classname, 31)
if(!equal(classname, lasermine_class)) return FMRES_IGNORED;
set_pev(i_Ent, pev_solid, SOLID_BBOX);
return FMRES_IGNORED;
}
/*------------------------------------------------------------------------------------
[Deixar a Lasermine Inquebravel]
-------------------------------------------------------------------------------------*/
public ltm_takedamage(victim, inflictor, attacker, Float:f_Damage, bit_Damage)
{
if(get_pcvar_num(cvar_breakable))
{
if(!pev_valid(victim)) return PLUGIN_CONTINUE;
new EntityName[32]; pev(victim, pev_classname, EntityName, 31);
if(!equal(EntityName, lasermine_class)) return PLUGIN_CONTINUE;
new i_Owner = pev(victim, LASERMINE_OWNER)
#if defined FORFUN
if(i_Owner != attacker && cs_get_user_team(attacker) == cs_get_user_team(i_Owner)) return HAM_SUPERCEDE;
#else
if(i_Owner != attacker && !zp_get_user_zombie(attacker)) return HAM_SUPERCEDE;
#endif
return PLUGIN_CONTINUE
}
return PLUGIN_CONTINUE
}
/*------------------------------------------------------------------------------------
[Mostrar o Nome de Quem Plantou a Bagaça]
-------------------------------------------------------------------------------------*/
public client_putinserver(id) set_task(1.0, "Task_CheckAiming", id + 3389, _, _, "b" );
public client_disconnect(id) remove_task(id + 3389)
public Task_CheckAiming( iTaskIndex )
{
static iPlayer; iPlayer = iTaskIndex - 3389;
static iEntity, iDummy, cClassname[ 32 ]; get_user_aiming( iPlayer, iEntity, iDummy, 9999 ); pev( iEntity, pev_classname, cClassname, 31 );
new id, name[32]; id = pev(iEntity, LASERMINE_OWNER); get_user_name(id, name, 31);
if(is_user_alive(iPlayer) && pev_valid(iEntity) && equal(cClassname, lasermine_class) && get_pcvar_num(cvar_show_status))
{
set_hudmessage( 50, 100, 150, -1.0, 0.60, 0, 6.0, 1.1, 0.0, 0.0, -1 );
show_hudmessage( iPlayer, "Lasermine Plantado Por: %s^nVida do Laser %d", name, pev(iEntity, pev_health ));
}
}