Nome Plugin:M4A1 e Ak47 evoluem
Descrição:Quando um player mata um zumbi com M4A1 ou AK47 evoluem so a skin.
Onde Você olho esse plugin:DH
Descrição:Quando um player mata um zumbi com M4A1 ou AK47 evoluem so a skin.
Onde Você olho esse plugin:DH
Código:
#include <amxmodx>
#include <engine>
#include <zombieplague>
#include <hamsandwich>
#define PLUGIN "Thunder Carabine M4A1"
#define VERSION "2.5"
#define AUTHOR "-"
#define is_valid_player(%1) (1 <= %1 <= 32)
new v_stix_m4a1[]="models/zombie_plague/v_m4a1_thunderEXT.mdl"
new const p_stix_m4a1[] = "models/zombie_plague/p_m4a1_thunderEXT.mdl"
new bool:g_bHasStixm4a1[33]
new g_Smoke,g_Lightning
new const sound_thunder[] = "ambience/thunder_clap.wav"
new cvar_dmgmultiplier
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_dmgmultiplier = register_cvar("zp_thunderdmg_m4a1", "0.5")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("DeathMsg", "DeathMsg", "a")
RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")
register_event("CurWeapon", "event_CurWeapon", "be", "1=1")
}
public fwHamTakeDamage(victim, inflictor, attacker, Float:damage)
{
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_M4A1 && g_bHasStixm4a1[attacker] )
{
SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
}
}
public plugin_precache()
{
precache_model(v_stix_m4a1)
precache_model(p_stix_m4a1)
precache_sound(sound_thunder)
g_Lightning = precache_model("sprites/lgtning.spr");
g_Smoke = precache_model("sprites/steam1.spr");
}
public client_connect(id)
{
g_bHasStixm4a1[id] = false
}
public client_disconnect(id)
{
g_bHasStixm4a1[id] = false
}
public zp_user_infected_post(infected, infector)
{
if (g_bHasStixm4a1[infected])
{
g_bHasStixm4a1[infected] = false
}
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
g_bHasStixm4a1[victim] = false
}
public ham_PlayerSpawn_Post(id)
{
g_bHasStixm4a1[id] = false
return PLUGIN_CONTINUE
}
public event_round_start()
{
for (new i = 1; i <= 32; i++)
{
g_bHasStixm4a1[i] = false
}
}
public DeathMsg()
{
new Killer = read_data(1) // Assassin
new vOrigin[3],coord[3];
new victim = read_data(2);
get_user_origin(victim,vOrigin);
vOrigin[2] -= 26
coord[0] = vOrigin[0] + 150;
coord[1] = vOrigin[1] + 150;
coord[2] = vOrigin[2] + 800;
if(get_user_weapon(Killer) == CSW_M4A1) // If use the m4a1 weapon
{
create_thunder(coord,vOrigin);
emit_sound(victim,CHAN_ITEM, sound_thunder, 1.0, ATTN_NORM, 0, PITCH_NORM);
emit_sound(Killer,CHAN_ITEM, sound_thunder, 1.0, ATTN_NORM, 0, PITCH_NORM);
set_model(Killer)
}
}
create_thunder(vec1[3],vec2[3])
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(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(g_Lightning);
write_byte(1);
write_byte(5);
write_byte(2);
write_byte(20);
write_byte(30);
write_byte(200);
write_byte(200);
write_byte(200);
write_byte(200);
write_byte(200);
message_end();
message_begin( MSG_PVS, SVC_TEMPENTITY,vec2);
write_byte(TE_SPARKS);
write_coord(vec2[0]);
write_coord(vec2[1]);
write_coord(vec2[2]);
message_end();
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec2);
write_byte(TE_SMOKE);
write_coord(vec2[0]);
write_coord(vec2[1]);
write_coord(vec2[2]);
write_short(g_Smoke);
write_byte(10);
write_byte(10)
message_end();
}
public set_model(id)
{
g_bHasStixm4a1[id] = true
}
public event_CurWeapon(id)
{
new weapid = read_data(2)
if(!is_user_alive(id))
return;
if(g_bHasStixm4a1[id] && weapid == CSW_M4A1)
{
entity_set_string(id, EV_SZ_viewmodel, v_stix_m4a1)
entity_set_string(id, EV_SZ_weaponmodel, p_stix_m4a1)
}
}
Código:
#include <amxmodx>
#include <engine>
#include <zombieplague>
#include <hamsandwich>
#define PLUGIN "Thunder Carabine AK47"
#define VERSION "2.5"
#define AUTHOR "-"
#define is_valid_player(%1) (1 <= %1 <= 32)
new v_stix_ak47[]="models/zombie_plague/v_ak47_thunderEXT.mdl"
new const p_stix_ak47[] = "models/zombie_plague/p_ak47_thunderEXT.mdl"
new bool:g_bHasStixak47[33]
new g_Smoke,g_Lightning
new const sound_thunder[] = "ambience/thunder_clap.wav"
new cvar_dmgmultiplier
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_dmgmultiplier = register_cvar("zp_thunderdmg_ak47", "0.5")
register_event("HLTV", "event_round_start", "a", "1=0", "2=0")
register_event("DeathMsg", "DeathMsg", "a")
RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawn_Post", 1)
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_TakeDamage, "player", "fwHamTakeDamage")
register_event("CurWeapon", "event_CurWeapon", "be", "1=1")
}
public fwHamTakeDamage(victim, inflictor, attacker, Float:damage)
{
if ( is_valid_player( attacker ) && get_user_weapon(attacker) == CSW_AK47 && g_bHasStixak47[attacker] )
{
SetHamParamFloat(4, damage * get_pcvar_float( cvar_dmgmultiplier ) )
}
}
public plugin_precache()
{
precache_model(v_stix_ak47)
precache_model(p_stix_ak47)
precache_sound(sound_thunder)
g_Lightning = precache_model("sprites/lgtning.spr");
g_Smoke = precache_model("sprites/steam1.spr");
}
public client_connect(id)
{
g_bHasStixak47[id] = false
}
public client_disconnect(id)
{
g_bHasStixak47[id] = false
}
public zp_user_infected_post(infected, infector)
{
if (g_bHasStixak47[infected])
{
g_bHasStixak47[infected] = false
}
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
g_bHasStixak47[victim] = false
}
public ham_PlayerSpawn_Post(id)
{
g_bHasStixak47[id] = false
return PLUGIN_CONTINUE
}
public event_round_start()
{
for (new i = 1; i <= 32; i++)
{
g_bHasStixak47[i] = false
}
}
public DeathMsg()
{
new Killer = read_data(1) // Assassin
new vOrigin[3],coord[3];
new victim = read_data(2);
get_user_origin(victim,vOrigin);
vOrigin[2] -= 26
coord[0] = vOrigin[0] + 150;
coord[1] = vOrigin[1] + 150;
coord[2] = vOrigin[2] + 800;
if(get_user_weapon(Killer) == CSW_AK47) // If use the ak47 weapon
{
create_thunder(coord,vOrigin);
emit_sound(victim,CHAN_ITEM, sound_thunder, 1.0, ATTN_NORM, 0, PITCH_NORM);
emit_sound(Killer,CHAN_ITEM, sound_thunder, 1.0, ATTN_NORM, 0, PITCH_NORM);
set_model(Killer)
}
}
create_thunder(vec1[3],vec2[3])
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(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(g_Lightning);
write_byte(1);
write_byte(5);
write_byte(2);
write_byte(20);
write_byte(30);
write_byte(200);
write_byte(200);
write_byte(200);
write_byte(200);
write_byte(200);
message_end();
message_begin( MSG_PVS, SVC_TEMPENTITY,vec2);
write_byte(TE_SPARKS);
write_coord(vec2[0]);
write_coord(vec2[1]);
write_coord(vec2[2]);
message_end();
message_begin(MSG_BROADCAST,SVC_TEMPENTITY,vec2);
write_byte(TE_SMOKE);
write_coord(vec2[0]);
write_coord(vec2[1]);
write_coord(vec2[2]);
write_short(g_Smoke);
write_byte(10);
write_byte(10)
message_end();
}
public set_model(id)
{
g_bHasStixak47[id] = true
}
public event_CurWeapon(id)
{
new weapid = read_data(2)
if(!is_user_alive(id))
return;
if(g_bHasStixak47[id] && weapid == CSW_AK47)
{
entity_set_string(id, EV_SZ_viewmodel, v_stix_ak47)
entity_set_string(id, EV_SZ_weaponmodel, p_stix_ak47)
}
}
Código:
/*************************************************************************************
[ZP] Thunder Carabine by Lucas_7_94 For Allied Mods .
Enjoy The Plugin =D
***************************************************************************************/
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include < fun >
#include <hamsandwich>
#include <engine>
#include <fakemeta>
#define NAME "[ZP] Extra Item : Thunder Carabine"
#define VERSION "v1.5"
#define CREATOR "lucas_7_94"
// Put Your Model =D
new const v_thunder[] = "models/v_Thunder_m4a1.mdl"
new const p_thunder[] = "models/p_Thunder_m4a1.mdl"
/*==========Customization==========*/
new bool: g_HasThunderCarabine[33]
new Thunder, g_maxplayers
/*===== End Customization ======*/
#define is_valid_player(%1) (1 <= %1 <= g_maxplayers) // Thanks You meTaLicross's gauss. =D
public plugin_init()
{
register_plugin(NAME, VERSION, CREATOR)
register_event("CurWeapon", "event_CurWeapon", "be", "1=1")
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage")
RegisterHam(Ham_Killed, "player", "fw_PlayerKilled")
RegisterHam(Ham_Spawn, "player", "fw_player_spawn", 1)
g_maxplayers = get_maxplayers()
}
public plugin_precache()
{
Thunder = precache_model("sprites/lgtning.spr");
precache_sound( "ambience/thunder_clap.wav" )
precache_model(v_thunder)
precache_model(p_thunder)
}
public client_disconnect(id) g_HasThunderCarabine[id] = false;
public client_putinserver(id) g_HasThunderCarabine[id] = false;
public fw_player_spawn(id)
{
if (g_HasThunderCarabine[id])
{
g_HasThunderCarabine[id] = false
fm_strip_user_gun(id, CSW_M4A1)
}
}
public zp_user_infected_post(infected, infector)
{
if (g_HasThunderCarabine[infected])
{
g_HasThunderCarabine[infected] = false;
}
}
public fw_player_killed(victim, attacker, shouldgib)
{
if(g_HasThunderCarabine[victim])
{
g_HasThunderCarabine[victim] = false
}
}
public event_CurWeapon(id)
{
new weapid = read_data(2)
if(!is_user_alive(id))
return;
if(!g_HasThunderCarabine[id])
return;
if(g_HasThunderCarabine[id] && weapid == CSW_M4A1)
{
entity_set_string(id, EV_SZ_viewmodel, v_thunder)
entity_set_string(id, EV_SZ_weaponmodel, p_thunder)
}
}
public fw_PlayerKilled(victim, attacker, shouldgib)
{
if(!zp_get_user_zombie(victim))
return;
if(!is_valid_player(attacker))
return;
static killername[33], victimname[33]
get_user_name(attacker, killername, 31)
get_user_name(victim, victimname, 31)
g_HasThunderCarabine[victim] = false;
g_HasThunderCarabine[attacker]++;
new clip, ammo, wpnid = get_user_weapon(attacker, clip, ammo)
if(g_HasThunderCarabine[attacker] && wpnid == CSW_M4A1)
{
new vorigin[3],srco[3];
get_user_origin(victim, vorigin);
vorigin[2] -= 26
srco[0] = vorigin[0] + 150
srco[1] = vorigin[1] + 150
srco[2] = vorigin[2] + 800
set_user_rendering(victim, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 16);
ThunderCarabine(srco,vorigin);
ThunderCarabine(srco,vorigin);
ThunderCarabine(srco,vorigin);
if(g_HasThunderCarabine[victim])
{
g_HasThunderCarabine[victim] = false
}
}
}
ThunderCarabine(vec1[3],vec2[3])
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(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(Thunder);
write_byte(1);
write_byte(5);
write_byte(2);
write_byte(20);
write_byte(30);
write_byte(200);
write_byte(200);
write_byte(200);
write_byte(200);
write_byte(200);
message_end();
message_begin( MSG_PVS, SVC_TEMPENTITY,vec2);
write_byte(9);
write_coord(vec2[0]);
write_coord(vec2[1]);
write_coord(vec2[2]);
message_end();
}
/****************************************************
Stocks Ands Others
****************************************************/
stock bool:fm_strip_user_gun(index, wid = 0, const wname[] = "")
{
new ent_class[32];
if (!wid && wname[0])
copy(ent_class, sizeof ent_class - 1, wname);
else
{
new weapon = wid, clip, ammo;
if (!weapon && !(weapon = get_user_weapon(index, clip, ammo)))
return false;
get_weaponname(weapon, ent_class, sizeof ent_class - 1);
}
new ent_weap = fm_find_ent_by_owner(-1, ent_class, index);
if (!ent_weap)
return false;
engclient_cmd(index, "drop", ent_class);
new ent_box = pev(ent_weap, pev_owner);
if (!ent_box || ent_box == index)
return false;
dllfunc(DLLFunc_Think, ent_box);
return true;
}
stock fm_find_ent_by_owner(index, const classname[], owner, jghgtype = 0)
{
new strtype[11] = "classname", ent = index;
switch (jghgtype)
{
case 1: strtype = "target";
case 2: strtype = "targetname";
}
while ((ent = engfunc(EngFunc_FindEntityByString, ent, strtype, classname)) && pev(ent, pev_owner) != owner) {}
return ent;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang11274\\ f0\\ fs16 \n\\ par }
*/
Soukito escreveu:sim em algumas, nessa cvar você muda:obs elas tira dmg extra?
Código:
cvar_dmgmultiplier = register_cvar("zp_thunderdmg_EXEMPLO", "2.0")
waLLzyk escreveu:ou poe 1.5 e melhorSoukito escreveu:sim em algumas, nessa cvar você muda:obs elas tira dmg extra?Para deixar o dano normal substitua o 2.0 por 1.0Código:
cvar_dmgmultiplier = register_cvar("zp_thunderdmg_EXEMPLO", "2.0")
|
|