Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
Modificare pluginuri
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
600
AnAcKiNNN12345
[Mentally Stable]
Status: Offline
(since 30-01-2017 13:00)
Joined: 22 Feb 2015
Posts: 230
,
Topics: 42
Location:
Romania
Reputation:
104
Votes
: 4
Posted: 08-03-2016, 17:19:06
| Translate post to:
... (
Click for more languages
)
Salut vreau sa imi modificati si mie cateva pluginuri :
1. ZOmbie finger sa fie la vip
Spoiler:
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <engine>
#include <zombiexp>
#include <zmvip>
#define skill1reload 15.0//peneration reload time(sec.)
#define skill1damage 35.0//peneration damage
#define skill2reload 20.0//jumpup reload time(sec.)
#define gravity_time 5.0//gravitation time
new const zclass1_name[] = { "STING_FINGER" }
new const zclass1_info[] = { "STING_FINGER_INFO" }
new const zclass1_model[] = { "sas" }
new const zclass1_clawmodel[] = { "v_finger.mdl" }
const zclass1_health = 1800
const zclass1_speed = 270
const Float:zclass1_gravity = 1.0
const Float:zclass1_knockback = 1.0
const zclass_level = 60 // level required to use
new finger
new g_player_model[33] [32]
new g_ent_playermodel[33]
new g_blood,g_bloodspray
new const oldknife_sounds[][] =
{
"weapons/knife_deploy1.wav",
"weapons/knife_hit1.wav",
"weapons/knife_hit2.wav",
"weapons/knife_hit3.wav",
"weapons/knife_hit4.wav",
"weapons/knife_hitwall1.wav",
"weapons/knife_slash1.wav",
"weapons/knife_slash2.wav",
"weapons/knife_stab.wav"
}
public plugin_init()
{
register_forward(FM_EmitSound, "fw_EmitSound")
register_logevent("round_start", 2, "1=Round_Start")
register_event("CurWeapon","CurrentWeapon","be","1=1")
RegisterHam(Ham_Player_PreThink,"player","fw_prethink")
RegisterHam(Ham_Spawn,"player","fw_spawn",1)
RegisterHam(Ham_TakeDamage, "player", "fw_takedmg")
RegisterHam(Ham_Killed,"player","fw_killed")
finger = zv_register_zombie_class(zclass1_name, zclass1_info, zclass1_model, zclass1_clawmodel, zclass1_health, zclass1_speed, zclass1_gravity, zclass1_knockback, zclass1_level)
}
public plugin_precache()
{
register_plugin("[ZP] Sting finger", "1.0", "Barney")
precache_model("models/player/finger/finger.mdl")
precache_sound("zombi/resident_skill2.wav")
precache_model("models/v_zombibomb_resident.mdl")
precache_model("models/p_zombiebomb.mdl")
g_blood = precache_model("sprites/blood.spr")
g_bloodspray = precache_model("sprites/bloodspray.spr")
}
public zp_user_infected_post(id,attacker)
{
if(zp_get_user_nemesis(id))
{
if(is_valid_ent(g_ent_playermodel[id]))
set_entity_visibility(g_ent_playermodel[id],0)
fm_set_rendering(id)
}
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == finger && !zp_get_user_nemesis(id))
{
emit_sound(id,CHAN_VOICE,"zombi/resident_skill2.wav",1.0,ATTN_NORM,0,PITCH_HIGH)
copy(g_player_model[id], sizeof g_player_model[] - 1, "finger")
fm_set_playermodel_ent(id, g_player_model[id],0)
set_entity_visibility(g_ent_playermodel[id],1)
}
}
public zp_user_humanized_post(id)
{
if(is_valid_ent(g_ent_playermodel[id]))
set_entity_visibility(g_ent_playermodel[id],0)
fm_set_rendering(id)
}
public fw_spawn(id)
{
if(is_user_alive(id) && !zp_get_user_zombie(id))
{
if(is_valid_ent(g_ent_playermodel[id]))
set_entity_visibility(g_ent_playermodel[id],0)
fm_set_rendering(id)
}
}
public round_start()
{
for(new i=1;i<get_maxplayers();i++)
{
if(!zp_get_user_zombie(i))
{
if(is_valid_ent(g_ent_playermodel[i]))
set_entity_visibility(g_ent_playermodel[i],0)
fm_set_rendering(i)
}
}
}
public fw_EmitSound(id, channel, sound[])
{
if(!is_user_alive(id) || get_user_weapon(id) != CSW_KNIFE)
return FMRES_IGNORED
for(new i = 0; i < sizeof oldknife_sounds; i++)
{
if(equal(sound, oldknife_sounds[i]) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == finger && !zp_get_user_nemesis(id))
{
return FMRES_SUPERCEDE
}
}
return FMRES_IGNORED
}
public fw_takedmg(victim, inflictor, id, Float:damage, damagebits)
{
if(is_user_connected(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == finger && !zp_get_user_nemesis(id) && get_user_weapon(id) == CSW_KNIFE && is_user_alive(victim))
SetHamParamFloat(4, damage * 2.0)
}
public fw_prethink(id)
{
if(is_user_alive(id) && zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == finger && !zp_get_user_nemesis(id))
{
set_pev(id, pev_rendermode, kRenderTransTexture)
set_pev(id, pev_renderamt, 1.0)
client_print(id,print_center,"Health:%d",pev(id,pev_health))
static Float:g_lastskill[33],Float:g_lastskill1[33]
if(get_user_button(id) & IN_USE && get_user_weapon(id)== CSW_KNIFE && (get_gametime()-g_lastskill[id])>skill1reload)
{
screenfade(id,50)
use_skill(id)
UTIL_PlayWeaponAnimation(id,8)
remove_entity(g_ent_playermodel[id])
copy(g_player_model[id], sizeof g_player_model[] - 1, "finger")
fm_set_playermodel_ent(id, g_player_model[id],91)
g_lastskill[id]=get_gametime()
}
if(get_user_button(id) & IN_RELOAD && get_user_weapon(id)== CSW_KNIFE && (get_gametime()-g_lastskill1[id])>skill2reload)
{
screenfade(id,50)
use_skill1(id)
UTIL_PlayWeaponAnimation(id,9)
remove_entity(g_ent_playermodel[id])
copy(g_player_model[id], sizeof g_player_model[] - 1, "finger")
fm_set_playermodel_ent(id, g_player_model[id],98)
g_lastskill1[id]=get_gametime()
}
}
}
public fw_killed(id)
{
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == finger && !zp_get_user_nemesis(id))
set_task(4.0,"origin",id+11)
}
public origin(id)
{
id-=11
new Float:Origin[3]
pev(id,pev_origin,Origin)
Origin[2]-=1000000.0
set_pev(id,pev_origin,Origin)
}
public use_skill(id)
{
static Body, Target
get_user_aiming(id, Target, Body, 150)
set_pdata_float(id,83, 1.0 , 5)
if(Target)
{
if(is_user_alive(Target))
{
switch(Body)
{
case HIT_HEAD: skill1damage * 4.0
case HIT_STOMACH: skill1damage * 2.0
}
make_blood(Target)
ExecuteHamB(Ham_TakeDamage, Target, 0, id, skill1damage, DMG_SLASH)
}
}
}
public use_skill1(id)
{
set_pdata_float(id,83, 1.3, 5)
set_pev(id,pev_gravity,0.5)
set_task(gravity_time,"end_skill",id+111)
}
public end_skill(id)
{
id=id-111
set_pdata_float(id,83, 1.0 , 5)
UTIL_PlayWeaponAnimation(id,10)
set_pev(id,pev_gravity,1.0)
}
public CurrentWeapon(id)
{
if(zp_get_user_zombie(id) && zp_get_user_zombie_class(id) == finger && !zp_get_user_nemesis(id))
{
if(get_user_weapon(id)==CSW_HEGRENADE || get_user_weapon(id) == CSW_SMOKEGRENADE)
{
set_pev(id,pev_viewmodel2,"models/v_zombibomb_resident.mdl")
set_pev(id, pev_weaponmodel2, "models/p_zombiebomb.mdl")
}
}
}
stock fm_set_playermodel_ent(id, const modelname[],anim)
{
fm_set_rendering(id, kRenderFxNone, 255, 255, 255, kRenderTransTexture, 1)
static modelpath[100]
formatex(modelpath, sizeof modelpath - 1, "models/player/%s/%s.mdl", modelname, modelname)
if (!pev_valid(g_ent_playermodel[id]))
{
g_ent_playermodel[id] = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
if (!pev_valid(g_ent_playermodel[id])) return
set_pev(g_ent_playermodel[id], pev_classname, "finger_classname")
set_pev(g_ent_playermodel[id], pev_movetype, MOVETYPE_FOLLOW)
set_pev(g_ent_playermodel[id], pev_aiment, id)
set_pev(g_ent_playermodel[id], pev_animtime, get_gametime()+0.1)
set_pev(g_ent_playermodel[id], pev_framerate, 1.0)
set_pev(g_ent_playermodel[id], pev_sequence, anim)
set_pev(g_ent_playermodel[id], pev_owner, id)
}
engfunc(EngFunc_SetModel, g_ent_playermodel[id], modelpath)
}
stock make_blood(id)
{
static Float:Origin[3]
pev(id, pev_origin, Origin)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BLOODSPRITE)
write_coord(floatround(Origin[0]))
write_coord(floatround(Origin[1]))
write_coord(floatround(Origin[2]))
write_short(g_bloodspray)
write_short(g_blood)
write_byte(70)
write_byte(20)
message_end()
}
stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
set_pev(Player, pev_weaponanim, Sequence)
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
write_byte(Sequence)
write_byte(pev(Player, pev_body))
message_end()
}
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))
}
stock screenfade(id,ammount)
{
message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( "ScreenFade" ), _, id )
write_short(1<<12)
write_short(1<<12)
write_short( 0x0000 )
write_byte( 255 )
write_byte( 255 )
write_byte( 255 )
write_byte( ammount )
message_end( )
}
Am incercat eu sa il fac dar imi da eroare > zp_finger.sma(51) : error 017: undefined symbol "zv_register_zombie_class"
2. Ethereal sa fie la vip
Spoiler:
#include <amxmodx>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>
#include <xs>
#include <cstrike>
#include <zombieplague>
#include <zmvip>
#define ENG_NULLENT -1
#define EV_INT_WEAPONKEY EV_INT_impulse
#define WEAPONKEY 33
#define MAX_PLAYERS 32
#define IsValidUser(%1) (1 <= %1 <= g_MaxPlayers)
const USE_STOPPED = 0
const OFFSET_ACTIVE_ITEM = 373
const OFFSET_WEAPONOWNER = 41
const OFFSET_LINUX = 5
const OFFSET_LINUX_WEAPONS = 4
#define WEAP_LINUX_XTRA_OFF 4
#define m_fKnown 44
#define m_flNextPrimaryAttack 46
#define m_flTimeWeaponIdle 48
#define m_iClip 51
#define m_fInReload 54
#define PLAYER_LINUX_XTRA_OFF 5
#define m_flNextAttack 83
#define RELOAD_TIME 3.0
#define wId CSW_UMP45
#define write_coord_f(%1) engfunc(EngFunc_WriteCoord,%1)
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
new const Sound_Zoom[] = { "weapons/zoom.wav" }
new const Fire_snd[] = {"weapons/ethereal-1.wav"}
new const went[] ={"weapon_ump45"}
new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }
new ethereal_V_MODEL[64] = "models/v_ethereal.mdl"
new ethereal_P_MODEL[64] = "models/p_ethereal.mdl"
new ethereal_W_MODEL[64] = "models/w_ethereal.mdl"
new cvar_recoil_ethereal, cvar_dmg_ethereal, g_itemid_ethereal, cvar_clip_ethereal, cvar_ethereal_ammo
new g_has_ethereal[33], g_hasZoom[33], Float:g_flNextUseTime[33], g_Reload[33]
new g_MaxPlayers, g_orig_event_ethereal, g_clip_ammo[33]
new Float:cl_pushangle[MAX_PLAYERS + 1][3], m_iBlood[2]
new g_ethereal_TmpClip[33],g_beamSpr,gmsgWeaponList
public plugin_init()
{
register_plugin("[ZP] Extra: Ethereal", "1.0", "Zombie-Panic")
register_event("CurWeapon","CurrentWeapon","be","1=1")
RegisterHam(Ham_Item_AddToPlayer, went, "fw_ethereal_AddToPlayer")
RegisterHam(Ham_Use, "func_tank", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tankmortar", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tankrocket", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Use, "func_tanklaser", "fw_UseStationary_Post", 1)
RegisterHam(Ham_Item_Deploy, went, "fw_Item_Deploy_Post", 1)
RegisterHam(Ham_Weapon_PrimaryAttack, went, "fw_ethereal_PrimaryAttack")
RegisterHam(Ham_Weapon_PrimaryAttack, went, "fw_ethereal_PrimaryAttack_Post", 1)
RegisterHam(Ham_Item_PostFrame, went, "ethereal__ItemPostFrame");
RegisterHam(Ham_Weapon_Reload, went, "ethereal__Reload");
RegisterHam(Ham_Weapon_Reload, went, "ethereal__Reload_Post", 1);
RegisterHam(Ham_TakeDamage, "info_target", "fw_TakeDamage")
RegisterHam(Ham_TraceAttack, "player", "TraceAttack", 1)
RegisterHam(Ham_TraceAttack, "worldspawn", "TraceAttack", 1)
register_forward(FM_SetModel, "fw_SetModel")
register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1)
register_forward(FM_PlaybackEvent, "fwPlaybackEvent")
RegisterHam(Ham_Item_Holster, "weapon_ump45", "fw_ethereal_Holster_Post", 1)
register_forward(FM_CmdStart, "fw_CmdStart")
cvar_recoil_ethereal = register_cvar("zp_Ethereal_recoil", "0.5")
cvar_dmg_ethereal = register_cvar("zp_Ethereal_dmg", "10")
cvar_clip_ethereal = register_cvar("zp_Ethereal_clip", "25")
cvar_ethereal_ammo = register_cvar("zp_Ethereal_ammo", "100")
g_itemid_ethereal = zv_register_extra_item("Ethereal", "Ethereal", 25, ZV_TEAM_HUMAN)
g_MaxPlayers = get_maxplayers()
gmsgWeaponList = get_user_msgid("WeaponList")
}
public plugin_precache()
{
precache_model(ethereal_V_MODEL)
precache_model(ethereal_P_MODEL)
precache_model(ethereal_W_MODEL)
precache_sound(Fire_snd)
precache_sound(Sound_Zoom)
precache_sound("weapons/ethereal_draw.wav")
precache_sound("weapons/ethereal_idle1.wav")
precache_sound("weapons/ethereal_reload.wav")
m_iBlood[0] = precache_model("sprites/blood.spr")
m_iBlood[1] = precache_model("sprites/bloodspray.spr")
register_forward(FM_PrecacheEvent, "fwPrecacheEvent_Post", 1)
g_beamSpr = precache_model("sprites/zbeam4.spr")
precache_generic("sprites/weapon_ethereal.txt")
precache_generic("sprites/640hud2.spr")
precache_generic("sprites/640hud74.spr")
precache_generic("sprites/640hud7.spr")
register_clcmd("weapon_ethereal", "Hook_Select")
}
public Hook_Select(id)
{
engclient_cmd(id, "weapon_ump45")
return PLUGIN_HANDLED
}
public fwPrecacheEvent_Post(type, const name[])
{
if (equal("events/ump45.sc", name))
{
g_orig_event_ethereal = get_orig_retval()
return FMRES_HANDLED
}
return FMRES_IGNORED
}
public fw_CmdStart(id, uc_handle, seed)
{
if(g_Reload[id])
return PLUGIN_HANDLED
if(!is_user_alive(id))
return PLUGIN_HANDLED
if((get_uc(uc_handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
{
new szClip, szAmmo
new szWeapID = get_user_weapon(id, szClip, szAmmo)
if(szWeapID == CSW_UMP45 && g_has_ethereal[id] && !g_hasZoom[id] == true)
{
g_hasZoom[id] = true
cs_set_user_zoom(id, CS_SET_AUGSG552_ZOOM, 0)
emit_sound(id, CHAN_ITEM, Sound_Zoom, 0.20, 2.40, 0, 100)
}
else if(szWeapID == CSW_UMP45 && g_has_ethereal[id] && g_hasZoom[id])
{
g_hasZoom[id] = false
cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
}
}
return PLUGIN_HANDLED
}
public client_connect(id)
{
g_has_ethereal[id] = false
}
public client_disconnect(id)
{
g_has_ethereal[id] = false
}public zp_user_infected_post(id)
{
if (zp_get_user_zombie(id))
{
g_has_ethereal[id] = false
}
}
public fw_SetModel(entity, model[])
{
if(!is_valid_ent(entity))
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
iOwner = entity_get_edict(entity, EV_ENT_owner)
if(equal(model, "models/w_ump45.mdl"))
{
static iStoredSVDID
iStoredSVDID = find_ent_by_owner(ENG_NULLENT, went, entity)
if(!is_valid_ent(iStoredSVDID))
return FMRES_IGNORED;
if(g_has_ethereal[iOwner])
{
entity_set_int(iStoredSVDID, EV_INT_WEAPONKEY, WEAPONKEY)
g_has_ethereal[iOwner] = false
entity_set_model(entity, ethereal_W_MODEL)
return FMRES_SUPERCEDE;
}
}
return FMRES_IGNORED;
}
public give_ethereal(id)
{
drop_weapons(id, 1);
new iWep2 = give_item(id,went)
if( iWep2 > 0 )
{
cs_set_weapon_ammo(iWep2, get_pcvar_num(cvar_clip_ethereal))
cs_set_user_bpammo (id, wId, get_pcvar_num(cvar_ethereal_ammo))
}
g_has_ethereal[id] = true;
}
public zv_extra_item_selected(id, itemid)
{
if(itemid == g_itemid_ethereal)
{
give_ethereal(id)
Sprite(id)
}
}
public fw_ethereal_AddToPlayer(ethereal, id)
{
if(!is_valid_ent(ethereal) || !is_user_connected(id))
return HAM_IGNORED;
if(entity_get_int(ethereal, EV_INT_WEAPONKEY) == WEAPONKEY)
{
g_has_ethereal[id] = true
entity_set_int(ethereal, EV_INT_WEAPONKEY, 0)
Sprite(id)
return HAM_HANDLED;
}
if(entity_get_int(ethereal, EV_INT_WEAPONKEY) != WEAPONKEY)
{
Sprite1(id)
return HAM_HANDLED;
}
return HAM_IGNORED;
}
public Sprite(id)
{
message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
write_string("weapon_ethereal")
write_byte(6)
write_byte(100)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(15)
write_byte(12)
write_byte(0)
message_end()
}
public Sprite1(id)
{
message_begin(MSG_ONE, gmsgWeaponList, {0,0,0}, id)
write_string("weapon_ump45")
write_byte(6)
write_byte(100)
write_byte(-1)
write_byte(-1)
write_byte(0)
write_byte(15)
write_byte(12)
write_byte(0)
message_end()
}
public fw_UseStationary_Post(entity, caller, activator, use_type)
{
if (use_type == USE_STOPPED && is_user_connected(caller))
replace_weapon_models(caller, get_user_weapon(caller))
}
public fw_Item_Deploy_Post(weapon_ent)
{
static owner
owner = fm_cs_get_weapon_ent_owner(weapon_ent)
static weaponid
weaponid = cs_get_weapon_id(weapon_ent)
replace_weapon_models(owner, weaponid)
UTIL_PlayWeaponAnimation(owner,2,2)
}
public CurrentWeapon(id)
{
replace_weapon_models(id, read_data(2))
}
replace_weapon_models(id, weaponid)
{
switch (weaponid)
{
case wId:
{
if (zp_get_user_zombie(id) || zp_get_user_survivor(id))
return;
if(g_has_ethereal[id])
{
set_pev(id, pev_viewmodel2, ethereal_V_MODEL)
set_pev(id, pev_weaponmodel2, ethereal_P_MODEL)
}
}
}
}
public fw_UpdateClientData_Post(Player, SendWeapons, CD_Handle)
{
if(!is_user_alive(Player) || (get_user_weapon(Player) != wId) || !g_has_ethereal[Player])
return FMRES_IGNORED
set_cd(CD_Handle, CD_flNextAttack, halflife_time () + 0.001)
return FMRES_HANDLED
}
public fw_ethereal_PrimaryAttack(Weapon)
{
new Player = get_pdata_cbase(Weapon, 41, 4)
if (!g_has_ethereal[Player])
return;
pev(Player,pev_punchangle,cl_pushangle[Player])
g_clip_ammo[Player] = cs_get_weapon_ammo(Weapon)
if(g_clip_ammo[Player]>0)
UTIL_PlayWeaponAnimation(Player, 5,2)
}
public fwPlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
if ((eventid != g_orig_event_ethereal))
return FMRES_IGNORED
if (!(1 <= invoker <= g_MaxPlayers))
return FMRES_IGNORED
playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
return FMRES_SUPERCEDE
}
public fw_ethereal_PrimaryAttack_Post(Weapon)
{ new Player = get_pdata_cbase(Weapon, 41, 4)
new szClip, szAmmo
get_user_weapon(Player, szClip, szAmmo)
if(Player > 0 && Player < 33)
{
if(g_has_ethereal[Player])
{
if(szClip > 0)emit_sound(Player, CHAN_WEAPON, Fire_snd, VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
}
if(g_has_ethereal[Player])
{
new Float:push[3]
pev(Player,pev_punchangle,push)
xs_vec_sub(push,cl_pushangle[Player],push)
xs_vec_mul_scalar(push,get_pcvar_float(cvar_recoil_ethereal),push)
xs_vec_add(push,cl_pushangle[Player],push)
set_pev(Player,pev_punchangle,push)
if (!g_clip_ammo[Player])
return
//show_tracer_effect(Player)
make_blood_and_bulletholes(Player)
}
}
}
public TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
if( !is_user_alive(iAttacker) || !g_has_ethereal[iAttacker])
return
new iWeapon = get_user_weapon(iAttacker)
if( iWeapon !=CSW_UMP45 )
return
new szClip
get_user_weapon(iAttacker, szClip)
if(szClip < 1)
return
new flEnd[3]
get_tr2(ptr, TR_vecEndPos, flEnd)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY )
write_byte(TE_BEAMENTPOINT)
write_short(iAttacker | 0x1000)
write_coord_f(flEnd[0])
write_coord_f(flEnd[1])
write_coord_f(flEnd[2])
write_short(g_beamSpr)
write_byte(0) // framerate
write_byte(0) // framerate
write_byte(1) // life
write_byte(5) // width
write_byte(0)// noise
write_byte(255)// r, g, b
write_byte(0)// r, g, b
write_byte(0)// r, g, b
write_byte(255) // brightness
write_byte(200) // speed
message_end()
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if (victim != attacker && is_user_connected(attacker))
{
if(get_user_weapon(attacker) == wId)
{
if(g_has_ethereal[attacker])
SetHamParamFloat(10, damage * get_pcvar_float(cvar_dmg_ethereal))
}
}
}
stock fm_cs_get_current_weapon_ent(id)
{
return get_pdata_cbase(id, OFFSET_ACTIVE_ITEM, OFFSET_LINUX);
}
stock fm_cs_get_weapon_ent_owner(ent)
{
return get_pdata_cbase(ent, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS);
}
stock UTIL_PlayWeaponAnimation(const Player, const Sequence,body)
{
set_pev(Player, pev_weaponanim, Sequence)
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
write_byte(Sequence)
write_byte(body)//pev(Player, pev_body))
message_end()
}
stock make_blood_and_bulletholes(id)
{
new aimOrigin[3], target, body
get_user_origin(id, aimOrigin, 3)
get_user_aiming(id, target, body)
if(target > 0 && target <= g_MaxPlayers && zp_get_user_zombie(target))
{
new Float:fStart[3], Float:fEnd[3], Float:fRes[3], Float:fVel[3]
pev(id, pev_origin, fStart)
velocity_by_aim(id, 64, fVel)
fStart[0] = float(aimOrigin[0])
fStart[1] = float(aimOrigin[1])
fStart[2] = float(aimOrigin[2])
fEnd[0] = fStart[0]+fVel[0]
fEnd[1] = fStart[1]+fVel[1]
fEnd[2] = fStart[2]+fVel[2]
new res
engfunc(EngFunc_TraceLine, fStart, fEnd, 0, target, res)
get_tr2(res, TR_vecEndPos, fRes)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BLOODSPRITE)
write_coord(floatround(fStart[0]))
write_coord(floatround(fStart[1]))
write_coord(floatround(fStart[2]))
write_short( m_iBlood [ 1 ])
write_short( m_iBlood [ 0 ] )
write_byte(70)
write_byte(random_num(1,2))
message_end()
}
else if(!is_user_connected(target))
{
if(target)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DECAL)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1])
write_coord(aimOrigin[2])
write_byte(GUNSHOT_DECALS[random_num ( 0, sizeof GUNSHOT_DECALS -1 ) ] )
write_short(target)
message_end()
}
else
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1])
write_coord(aimOrigin[2])
write_byte(GUNSHOT_DECALS[random_num ( 0, sizeof GUNSHOT_DECALS -1 ) ] )
message_end()
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_GUNSHOTDECAL)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1])
write_coord(aimOrigin[2])
write_short(id)
write_byte(GUNSHOT_DECALS[random_num ( 0, sizeof GUNSHOT_DECALS -1 ) ] )
message_end()
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1])
write_coord(aimOrigin[2])
message_end()
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
write_coord(aimOrigin[0]+2)
write_coord(aimOrigin[1])
write_coord(aimOrigin[2])
message_end()
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1]+2)
write_coord(aimOrigin[2])
message_end()
message_begin(MSG_ALL, SVC_TEMPENTITY)
write_byte(TE_SPARKS)
write_coord(aimOrigin[0])
write_coord(aimOrigin[1])
write_coord(aimOrigin[2]+2)
message_end()
}
}
public ethereal__ItemPostFrame(weapon_entity) {
new id = pev(weapon_entity, pev_owner)
if (!is_user_connected(id))
return HAM_IGNORED;
if (!g_has_ethereal[id])
return HAM_IGNORED;
new Float:flNextAttack = get_pdata_float(id, m_flNextAttack, PLAYER_LINUX_XTRA_OFF)
new iBpAmmo = cs_get_user_bpammo(id, wId);
new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)
new fInReload = get_pdata_int(weapon_entity, m_fInReload, WEAP_LINUX_XTRA_OFF)
if( fInReload && flNextAttack <= 0.0 )
{
new j = min(get_pcvar_num(cvar_clip_ethereal) - iClip, iBpAmmo)
set_pdata_int(weapon_entity, m_iClip, iClip + j, WEAP_LINUX_XTRA_OFF)
cs_set_user_bpammo(id, wId, iBpAmmo-j);
set_pdata_int(weapon_entity, m_fInReload, 0, WEAP_LINUX_XTRA_OFF)
fInReload = 0
}
return HAM_IGNORED;
}
public ethereal__Reload(weapon_entity) {
new id = pev(weapon_entity, pev_owner)
if (!is_user_connected(id))
return HAM_IGNORED;
if (!g_has_ethereal[id])
return HAM_IGNORED;
g_ethereal_TmpClip[id] = -1;
new iBpAmmo = cs_get_user_bpammo(id, wId);
new iClip = get_pdata_int(weapon_entity, m_iClip, WEAP_LINUX_XTRA_OFF)
if (iBpAmmo <= 0)
return HAM_SUPERCEDE;
if (iClip >= get_pcvar_num(cvar_clip_ethereal))
return HAM_SUPERCEDE;
UTIL_PlayWeaponAnimation(id, 1,2)
g_ethereal_TmpClip[id] = iClip;
return HAM_IGNORED;
}
public ethereal__Reload_Post(weapon_entity) {
new id = pev(weapon_entity, pev_owner)
if (!is_user_connected(id))
return HAM_IGNORED;
if (!g_has_ethereal[id])
return HAM_IGNORED;
if (g_ethereal_TmpClip[id] == -1)
return HAM_IGNORED;
set_pdata_int(weapon_entity, m_iClip, g_ethereal_TmpClip[id], WEAP_LINUX_XTRA_OFF)
set_pdata_float(weapon_entity, m_flTimeWeaponIdle, RELOAD_TIME, WEAP_LINUX_XTRA_OFF)
set_pdata_float(id, m_flNextAttack, RELOAD_TIME, PLAYER_LINUX_XTRA_OFF)
set_pdata_int(weapon_entity, m_fInReload, 1, WEAP_LINUX_XTRA_OFF)
UTIL_PlayWeaponAnimation(id, 1,2)
return HAM_IGNORED;
}
public fw_ethereal_Holster_Post(weapon_entity)
{
static Player
Player = get_pdata_cbase(weapon_entity, OFFSET_WEAPONOWNER, OFFSET_LINUX_WEAPONS)
g_flNextUseTime[Player] = 0.0
if(g_has_ethereal[Player])
{
cs_set_user_zoom(Player, CS_RESET_ZOOM, 1)
}
}
stock drop_weapons(id, dropwhat)
{
static weapons[32], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)
for (i = 0; i < num; i++)
{
weaponid = weapons[i]
if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
{
static wname[32]
get_weaponname(weaponid, wname, sizeof wname - 1)
engclient_cmd(id, "drop", wname)
}
}
}
stock fm_get_aim_vector(index, forward_distance, Float:forward_origin[3], Float:view_end_origin[3])
{
new Float:start[3], Float:view_ofs[3]
pev(index, pev_origin, start);
pev(index, pev_view_ofs, view_ofs);
xs_vec_add(start, view_ofs, start);
new Float:vector[3], Float:temp[3];
pev(index, pev_v_angle, vector);
engfunc(EngFunc_MakeVectors, vector);
global_get(glb_v_forward, vector);
xs_vec_mul_scalar(vector, float(forward_distance), temp);
xs_vec_add(start, temp, forward_origin);
new Float:dest[3]
xs_vec_mul_scalar(vector, 9999.0, temp);
xs_vec_add(start, temp, dest);
engfunc(EngFunc_TraceLine, start, dest, 0, index, 0);
get_tr2(0, TR_vecEndPos, view_end_origin);
return 1;
}
Am modificat eu dar nu imi da arma ( imi apare in meniu imi ia $$ dar nu imi da arma
3. Plasma nu merge compilat
Spoiler:
#include < amxmodx >
#include < fakemeta >
#include <
cstrike
>
#include < hamsandwich >
#include < zombieplague >
#include <zmvip>
new const PLUGIN_VERSION[ ] = "1.0.0 FINAL";
const OFFSET_WEAPONOWNER = 41
const OFFSET_LINUX = 5
const OFFSET_LINUX_WEAPONS = 4
const WEAP_KEY = 545464464
const MAX_PLAYERS = 32
const m_flNextPrimaryAttack = 46;
const m_iClip = 51;
const m_flNextAttack = 83;
const m_flTimeWeaponIdle = 48;
const m_szAnimExtention = 492
enum ( <<=1 )
{
DROP_PRIMARY = 1,
DROP_SECONDARY
};
const IDLE = 0
const RELOAD = 1
const DRAW = 2
const SHOOT_1 = 3
const SHOOT_END = 4
#define HoldCBaseWeapon(%0) ( get_user_weapon( %0 ) == g_iWeaponID && g_pWeaponA[ %0 ] )
#define IsValidPrivateData(%0) ( pev_valid( %0 ) == 2 )
#define PRECACHE_MODEL(%0) engfunc(EngFunc_PrecacheModel, %0)
#define PRECACHE_SOUND(%0) engfunc(EngFunc_PrecacheSound, %0)
#define PRECACHE_GENERIC(%0) engfunc(EngFunc_PrecacheGeneric, %0)
new const WEAPON_SOUND_FIRE[ ] = "weapons/plasmagun-1.wav";
new const WEAPON_SOUND_BOMB[ ] = "weapons/plasmagun_exp.wav";
new const WEAPON_LIST[ ] = "weapon_plasmagun";
new const WEAPON_BASE_NAME[ ] = "weapon_m249";
const Float: RELOAD_TIME = 3.36 //Время перезарядки
const AMMO__WEAPON = 200 //Кол-во обоймы
const CLIP__WEAPON = 45 //Кол-во патрон
const BALL__SPEED = 2000 //Скорость
const Float: BALL__DAMAGE = 200.0 //Урон
const Float: BALL__RADIUS = 125.0 //Радиус
const Float: WEAPON__SPEED = 0.15 //Скорость орудия
new const EXTRA_ITEM_NAME[ ] = "Plasmagun"; //Название в Extra-Items
new V_MODEL[ ] = "models/v_plasmagun.mdl";
new P_MODEL[ ] = "models/p_plasmagun.mdl";
new W_MODEL[ ] = "models/w_plasmagun.mdl";
new R_MODEL[ ] = "sprites/plasmaball.spr";
new const HUD_SPRITES[ ] [ ] =
{
"sprites/640hud3.spr" ,
"sprites/640hud91.spr"
};
new g_iItem , g_iForwardIndex , g_iExpSprite ;
new g_pWeaponA[ MAX_PLAYERS + 1 ] ;
new g_iWeaponID = 0;
new const BALL__CLASSNAME[ ] = "zsClassBall";
const WEAPONS_PRIMARY_BITSUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const WEAPONS_SECONDARY_BITSUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
public plugin_precache( )
{
PRECACHE_MODEL( V_MODEL );
PRECACHE_MODEL( P_MODEL );
PRECACHE_MODEL( W_MODEL );
PRECACHE_MODEL( R_MODEL );
PRECACHE_SOUNDS_FROM_MODEL( V_MODEL );
PRECACHE_SOUND( WEAPON_SOUND_BOMB );
PRECACHE_SOUND( WEAPON_SOUND_FIRE );
static iFile
for( iFile = 0 ; iFile < sizeof HUD_SPRITES; iFile++ )
{
PRECACHE_GENERIC( HUD_SPRITES[ iFile ] )
}
static szFile [ 128 ];
formatex ( szFile , charsmax( szFile ) , "sprites/%s.txt" , WEAPON_LIST );
PRECACHE_GENERIC( szFile );
g_iExpSprite = precache_model( "sprites/plasmabomb.spr" );
}
public plugin_init()
{
register_plugin( "[CSO] Extra Item PlasmaGun" , PLUGIN_VERSION , "Shurik07" );
register_clcmd( WEAPON_LIST, "weapon_hook_an" );
register_forward( FM_SetModel, "Forward_SetModel" , false );
register_forward( FM_UpdateClientData, "Forward_UpdateClientData" , true );
RegisterHam( Ham_Item_AddToPlayer, WEAPON_BASE_NAME, "CBaseWeapon__AddToPlayer__Post" , .Post = true );
RegisterHam( Ham_Item_Deploy, WEAPON_BASE_NAME , "CBaseWeapon__Deploy__Post", .Post = true );
RegisterHam( Ham_Weapon_PrimaryAttack, WEAPON_BASE_NAME, "CBaseWeapon__PrimaryAttack__Pre" , .Post = false );
RegisterHam( Ham_Item_PostFrame, WEAPON_BASE_NAME, "CBaseWeapon__PostFrame__Pre" , .Post = false );
RegisterHam( Ham_Weapon_Reload, WEAPON_BASE_NAME, "CBaseWeapon__Reload_Pre" , .Post = false );
RegisterHam( Ham_Weapon_WeaponIdle, WEAPON_BASE_NAME, "CBaseWeapon__Idle_Pre", false );
RegisterHam( Ham_TraceAttack, "player", "CBase__TraceAttack_Pre", false );
register_forward( FM_Touch , "Forward_Touch" );
g_iItem = zv_register_extra_item( EXTRA_ITEM_NAME, "Plasma", 0, ZV_TEAM_HUMAN );
g_iWeaponID = get_weaponid( WEAPON_BASE_NAME );
}
public zv_extra_item_selected( pPlayer , pItem )
{
if( pItem == g_iItem )
{
UTIL__DropWeapons( pPlayer, DROP_PRIMARY )
g_pWeaponA[ pPlayer ] = true;
static pEntity;
pEntity = fm_give_item( pPlayer , WEAPON_BASE_NAME );
if( pEntity > 0 ) cs_set_weapon_ammo( pEntity, CLIP__WEAPON );
cs_set_user_bpammo( pPlayer , g_iWeaponID , AMMO__WEAPON );
UTIL__WeaponList( pPlayer, WEAPON_LIST , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 );
}
}
public weapon_hook_an( pPlayer )
{
engclient_cmd( pPlayer, WEAPON_BASE_NAME);
return PLUGIN_HANDLED;
}
public zp_user_humanized_post( pPlayer )
{
g_pWeaponA[ pPlayer ] = false;
}
public client_disconnect( pPlayer )
{
g_pWeaponA[ pPlayer ] = false;
}
public Forward_SetModel( pEntity, const pModel[ ] )
{
if( !pev_valid( pEntity ) )
{
return FMRES_IGNORED;
}
static szClassName [ 33 ]
pev( pEntity, pev_classname, szClassName, charsmax(szClassName) );
if( !equal ( szClassName, "weaponbox" ) )
{
return FMRES_IGNORED;
}
static pOwner , pModel
pModel = fm_find_ent_by_owner ( -1, WEAPON_BASE_NAME, pEntity );
pOwner = pev ( pEntity, pev_owner );
if ( g_pWeaponA [ pOwner ] && pev_valid ( pModel ) )
{
set_pev( pModel , pev_impulse , WEAP_KEY );
engfunc( EngFunc_SetModel, pEntity, W_MODEL );
g_pWeaponA [ pOwner ] = false;
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public Forward_UpdateClientData( pPlayer , SendWeapons, CD_Handle )
{
if ( !HoldCBaseWeapon( pPlayer ) )
{
return HAM_IGNORED;
}
static Float:fGametime;
fGametime = get_gametime( );
set_cd ( CD_Handle, CD_flNextAttack, fGametime + 0.001 );
return FMRES_HANDLED;
}
public Forward_PlayBackEvent(flags, invoker, eventindex, Float:delay, Float:origin[3], Float:fvangles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
return FMRES_SUPERCEDE
}
public CBaseWeapon__AddToPlayer__Post( pEntity , pPlayer )
{
if( !pev_valid( pEntity ) && !is_user_connected( pPlayer ) )
{
return HAM_IGNORED;
}
if( pev( pEntity, pev_impulse) == WEAP_KEY )
{
g_pWeaponA[ pPlayer ] = true;
UTIL__WeaponList( pPlayer, WEAPON_LIST , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 );
return HAM_IGNORED ;
}
else
{
UTIL__WeaponList( pPlayer, WEAPON_BASE_NAME , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 )
}
return HAM_IGNORED;
}
public CBaseWeapon__Deploy__Post( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
if ( !g_pWeaponA[ pId ] )
{
return HAM_IGNORED;
}
set_pev( pId, pev_viewmodel2, V_MODEL);
set_pev( pId, pev_weaponmodel2, P_MODEL);
set_pdata_float( pId, m_flNextAttack, 1.0, OFFSET_LINUX );
set_pdata_float( pEntity, m_flTimeWeaponIdle, 1.0 , OFFSET_LINUX_WEAPONS );
set_pdata_string( pId, m_szAnimExtention * 4, "rifle" , -1, OFFSET_LINUX * 4);
UTIL_SenwWeaponAnim( pId, DRAW );
return HAM_IGNORED ;
}
public CBaseWeapon__PrimaryAttack__Pre(pEntity)
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId ; pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX_WEAPONS );
static Float: vecPuncheAngle[ 3 ];
if ( !HoldCBaseWeapon( pId ) || iClip <= 0 )
{
return HAM_IGNORED;
}
g_iForwardIndex = register_forward( FM_PlaybackEvent, "Forward_PlayBackEvent" , false )
pev(pId, pev_punchangle, vecPuncheAngle);
ExecuteHam(Ham_Weapon_PrimaryAttack, pEntity);
set_pev(pId, pev_punchangle, Float:{ -5.0, 0.0, 0.0 });
Ball__Create( pId )
emit_sound( pId, CHAN_WEAPON, WEAPON_SOUND_FIRE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
UTIL_SenwWeaponAnim( pId, SHOOT_1 );
set_pdata_float( pEntity, m_flNextPrimaryAttack , WEAPON__SPEED , OFFSET_LINUX_WEAPONS );
set_pdata_float( pEntity, m_flTimeWeaponIdle, WEAPON__SPEED + 3.0 , OFFSET_LINUX_WEAPONS );
unregister_forward(FM_PlaybackEvent, g_iForwardIndex , false);
return HAM_SUPERCEDE;
}
Ball__Create ( const pId )
{
static pEntity;
if ( ( pEntity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite") ) ) )
{
static Float:vf_vOrigin[ 3 ] , Float: vf_vAngle[ 3 ];
engfunc( EngFunc_GetAttachment , pId , 1 , vf_vOrigin , vf_vAngle )
set_pev ( pEntity, pev_classname , BALL__CLASSNAME );
set_pev ( pEntity, pev_movetype, MOVETYPE_FLY );
set_pev ( pEntity, pev_solid, SOLID_SLIDEBOX );
engfunc ( EngFunc_SetModel , pEntity, R_MODEL );
engfunc ( EngFunc_SetOrigin, pEntity, vf_vOrigin );
engfunc ( EngFunc_SetSize , pEntity, Float:{ 0.0, 0.0, 0.0 }, Float:{ 0.0, 0.0, 0.0 } );
set_pev ( pEntity, pev_renderfx, kRenderFxGlowShell );
set_pev ( pEntity, pev_rendermode, kRenderTransAdd );
set_pev ( pEntity, pev_renderamt, 255.0 )
set_pev ( pEntity, pev_scale , random_float( random_float( 0.1 , 0.2 ) , random_float( 0.3 , 0.4 ) ) );
set_pev ( pEntity, pev_iuser1 , pId );
static Float:vf_vVelocity[ 3 ];
velocity_by_aim( pId, BALL__SPEED, vf_vVelocity );
set_pev( pEntity, pev_velocity, vf_vVelocity );
static Float:vf_vAngles[ 3 ];
engfunc( EngFunc_VecToAngles, vf_vVelocity, vf_vAngles );
set_pev( pEntity, pev_angles, vf_vAngles );
}
}
public CBaseWeapon__PostFrame__Pre( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
if ( !is_user_connected( pId ) && !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
static fInReload ; fInReload = get_pdata_int( pEntity, 54, OFFSET_LINUX_WEAPONS );
static Float:flNextAttack ; flNextAttack = get_pdata_float( pId, m_flNextAttack, OFFSET_LINUX_WEAPONS );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX_WEAPONS );
static iAmmoType ; iAmmoType = 376 + get_pdata_int( pEntity, 49, OFFSET_LINUX_WEAPONS );
static iBpAmmo ; iBpAmmo = get_pdata_int( pId, iAmmoType, OFFSET_LINUX );
if ( fInReload && flNextAttack <= RELOAD_TIME )
{
static j ; j = min( CLIP__WEAPON - iClip, iBpAmmo);
set_pdata_int( pEntity, m_iClip, iClip + j, OFFSET_LINUX_WEAPONS );
set_pdata_int( pId, iAmmoType, iBpAmmo-j, OFFSET_LINUX );
set_pdata_int( pEntity, 54, 0, OFFSET_LINUX_WEAPONS );
}
return HAM_IGNORED;
}
public CBaseWeapon__Reload_Pre(pEntity)
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
static iAmmoType ; iAmmoType = 376 + get_pdata_int( pEntity, 49, OFFSET_LINUX_WEAPONS );
static iBpAmmo ; iBpAmmo = get_pdata_int( pId, iAmmoType, OFFSET_LINUX );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX );
if ( iBpAmmo <= 0 || iClip >= CLIP__WEAPON )
{
return HAM_SUPERCEDE;
}
set_pdata_int( pEntity, m_iClip, 0, OFFSET_LINUX_WEAPONS );
ExecuteHam( Ham_Weapon_Reload, pEntity );
set_pdata_int( pEntity, m_iClip, iClip, OFFSET_LINUX_WEAPONS );
if ( !is_user_connected( pId ) || !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
set_pdata_float( pId, m_flNextAttack, RELOAD_TIME , OFFSET_LINUX);
set_pdata_float( pEntity, m_flTimeWeaponIdle, RELOAD_TIME , OFFSET_LINUX_WEAPONS );
UTIL_SenwWeaponAnim(pId, RELOAD);
return HAM_SUPERCEDE;
}
public CBaseWeapon__Idle_Pre( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
ExecuteHamB( Ham_Weapon_ResetEmptySound, pEntity );
if (get_pdata_int(pEntity, m_flTimeWeaponIdle, OFFSET_LINUX_WEAPONS) > 0.0)
{
return HAM_IGNORED;
}
if ( !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
UTIL_SenwWeaponAnim ( pId, IDLE );
set_pdata_float( pEntity, m_flTimeWeaponIdle, random_float( 5.0 , 15.0 ) , OFFSET_LINUX_WEAPONS );
return HAM_SUPERCEDE;
}
public CBase__TraceAttack_Pre(const iEntity, const iAttacker, const Float: flDamage)
{
if ( is_user_connected( iAttacker ) && HoldCBaseWeapon( iAttacker ) )
{
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public Forward_Touch( const pEntity , const i_Other )
{
if( !pev_valid( pEntity ) )
{
return FMRES_IGNORED ;
}
static g_classname[ 32 ] ;
pev( pEntity, pev_classname, g_classname, 31 )
if( equali( g_classname, BALL__CLASSNAME ) )
{
static Float:flOrigin[ 3 ];
pev( pEntity, pev_origin, flOrigin );
engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0 );
write_byte( TE_EXPLOSION );
engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
write_short( g_iExpSprite );
write_byte( 5 );
write_byte( 15 );
write_byte( TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOSOUND );
message_end( );
emit_sound( pEntity, CHAN_WEAPON, WEAPON_SOUND_BOMB , VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
static pOwner , pevVictim ;
pOwner = pev( pEntity, pev_iuser1 ); pevVictim = -1;
while( ( pevVictim = engfunc( EngFunc_FindEntityInSphere, pevVictim, flOrigin, BALL__RADIUS) ) != 0 )
{
if( !is_user_alive( pevVictim ) )
continue;
if( !zp_get_user_zombie( pevVictim ) )
continue;
ExecuteHamB( Ham_TakeDamage, pevVictim, pEntity, pOwner, BALL__DAMAGE, DMG_SONIC );
}
engfunc( EngFunc_RemoveEntity , pEntity );
}
return FMRES_IGNORED ;
}
stock UTIL__DropWeapons(id, bitsDropType)
{
static weapons[32], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)
for (i = 0; i < num; i++)
{
weaponid = weapons[i]
if ((bitsDropType == DROP_PRIMARY && ((1<<weaponid) & WEAPONS_PRIMARY_BITSUM)) || (bitsDropType == DROP_SECONDARY && ((1<<weaponid) & WEAPONS_SECONDARY_BITSUM)))
{
static wname[32]
get_weaponname(weaponid, wname, charsmax(wname))
engclient_cmd(id, "drop", wname)
}
}
}
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) { /* keep looping */ }
return entity;
}
stock UTIL_SenwWeaponAnim(const pPlayer, const Sequence)
{
set_pev(pPlayer, pev_weaponanim, Sequence)
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = pPlayer)
write_byte(Sequence)
write_byte(pev(pPlayer, pev_body))
message_end()
}
UTIL__WeaponList( pPlayer, const szWeapon[ ], int, int2, int3, int4, int5, int6, int7, int8 )
{
message_begin( MSG_ONE, get_user_msgid( "WeaponList" ) , _, pPlayer );
write_string( szWeapon );
write_byte( int );
write_byte( int2);
write_byte( int3 );
write_byte( int4 );
write_byte( int5 );
write_byte( int6 );
write_byte( int7 );
write_byte( int8 );
message_end( );
}
stock fm_give_item(id, const item[])
{
static ent
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
if (!pev_valid(ent)) return 0;
static Float:originF[3]
pev(id, pev_origin, originF)
set_pev(ent, pev_origin, originF)
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
dllfunc(DLLFunc_Spawn, ent)
static save
save = pev(ent, pev_solid)
dllfunc(DLLFunc_Touch, ent, id)
if (pev(ent, pev_solid) != save)
return ent ;
engfunc(EngFunc_RemoveEntity, ent)
return -1;
}
PRECACHE_SOUNDS_FROM_MODEL(const szModelPath[])
{
new iFile;
if ((iFile = fopen(szModelPath, "rt")))
{
new szSoundPath[64];
new iNumSeq, iSeqIndex;
new iEvent, iNumEvents, iEventIndex;
fseek(iFile, 164, SEEK_SET);
fread(iFile, iNumSeq, BLOCK_INT);
fread(iFile, iSeqIndex, BLOCK_INT);
for (new k, i = 0; i < iNumSeq; i++)
{
fseek(iFile, iSeqIndex + 48 + 176 * i, SEEK_SET);
fread(iFile, iNumEvents, BLOCK_INT);
fread(iFile, iEventIndex, BLOCK_INT);
fseek(iFile, iEventIndex + 176 * i, SEEK_SET);
for (k = 0; k < iNumEvents; k++)
{
fseek(iFile, iEventIndex + 4 + 76 * k, SEEK_SET);
fread(iFile, iEvent, BLOCK_INT);
fseek(iFile, 4, SEEK_CUR);
if (iEvent != 5004)
{
continue;
}
fread_blocks(iFile, szSoundPath, 64, BLOCK_CHAR);
if (strlen(szSoundPath))
{
strtolower(szSoundPath);
PRECACHE_SOUND(szSoundPath);
}
}
}
}
fclose(iFile);
}
AMX Mod X Compiler 1.8.3-manual
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team
Modified for
http://www.Freakz.ro
/ amx.freakz.ro
1cso_weapon_plasmagun.sma(1) : error 010: invalid function or declaration
amx/include/fakemeta.inc(15) : error 017: undefined symbol "AMXX_VERSION_NUM"
amx/include/fakemeta.inc(247) : error 070: rational number support was not enabled
amx/include/cstrike.inc(13) : error 017: undefined symbol "AMXX_VERSION_NUM"
amx/include/hamsandwich.inc(47) : error 017: undefined symbol "AMXX_VERSION_NUM"
amx/include/hamsandwich.inc(361) : error 017: undefined symbol "get_func_id"
amx/include/hamsandwich.inc(364) : error 017: undefined symbol "callfunc_begin_i"
amx/include/hamsandwich.inc(366) : error 017: undefined symbol "callfunc_push_int"
amx/include/hamsandwich.inc(367) : error 017: undefined symbol "callfunc_push_int"
amx/include/hamsandwich.inc(368) : error 017: undefined symbol "callfunc_push_str"
amx/include/hamsandwich.inc(369) : error 017: undefined symbol "callfunc_end"
amx/include/hamsandwich.inc(376) : error 017: undefined symbol "set_fail_state"
1cso_weapon_plasmagun.sma(48) : error 070: rational number support was not enabled
1cso_weapon_plasmagun.sma(48) : warning 213: tag mismatch
1cso_weapon_plasmagun.sma(54) : error 070: rational number support was not enabled
1cso_weapon_plasmagun.sma(54) : warning 213: tag mismatch
1cso_weapon_plasmagun.sma(55) : error 070: rational number support was not enabled
1cso_weapon_plasmagun.sma(55) : warning 213: tag mismatch
1cso_weapon_plasmagun.sma(56) : error 070: rational number support was not enabled
1cso_weapon_plasmagun.sma(56) : warning 213: tag mismatch
1cso_weapon_plasmagun.sma(78) : error 017: undefined symbol "CSW_SCOUT"
1cso_weapon_plasmagun.sma(78) : error 008: must be a constant expression; assumed zero
1cso_weapon_plasmagun.sma(79) : error 017: undefined symbol "CSW_P228"
1cso_weapon_plasmagun.sma(79) : error 008: must be a constant expression; assumed zero
1cso_weapon_plasmagun.sma(99) : error 017: undefined symbol "formatex"
1cso_weapon_plasmagun.sma(102) : error 017: undefined symbol "precache_model"
1cso_weapon_plasmagun.sma(107) : error 017: undefined symbol "register_plugin"
1cso_weapon_plasmagun.sma(108) : error 017: undefined symbol "register_clcmd"
1cso_weapon_plasmagun.sma(124) : error 017: undefined symbol "get_weaponid"
1cso_weapon_plasmagun.sma(148) : error 017: undefined symbol "engclient_cmd"
Compilation aborted.
26 Errors.
Done.
4. Blood sa fie la vip
Spoiler:
/*================================================================================
-------------------------------------------
-*- [ZP] Extra Item: Blood Stone | by Re.Act!ve -*-
-------------------------------------------
~~~~~~~~~~~~~~~
- Description -
~~~~~~~~~~~~~~~
[RU] Эта вещь наделяет вас способностью "БлудСтоун". Когда вы вешаете эту штуку на человека, каждый его
последующий шаг будет приносить ему боль, отнимая жизни до тех пор пока он не умрет или ни кончится действие способности. Чтобы не терять жизней он должен остановится.
[EN] This thing allocates you with ability of "Blood Stone". When you hang up this piece on the person, its each subsequent
step will bring to it a pain, taking away lives until then while he won't die or ability action will come to an end. Not to lose lives
it should will stop.
~~~~~~~~~~~~~~~
- Credits -
~~~~~~~~~~~~~~~
Re.Act!ve This Creator of zombie class plugin
JTP10181 Thanks to Amx Gore Ultimate code
~~~~~~~~~~~~~~~
- Changelog -
~~~~~~~~~~~~~~~
v. 1.0 - First Plugin Released
v. 1.1 - Fixed Bug CoolDown & Added New option
v. 1.2 - Added Effect AMX Gore Blood Stream
v. 1.3 - Fixed RunTime Error. fixed health death bug.
v. 1.4 - Fixed Bug No Win Ammo packs. Add Sound miss bloodstone. Fixed small bugs
================================================================================*/
#include <amxmodx>
#include <engine>
#include <fakemeta_util>
#include <zombieplague>
#include <zmvip>
#define PLUGIN "[ZP] Extra Item: Blood Stone"
#define VERSION "1.4"
#define AUTHOR "Re.Act!ve"
#define is_valid_player(%1) (1 <= %1 <= 32)
// Amx Gore Defined
#define MAX_PLAYERS 32
#define GORE_BLEEDING (1<<2)
#define BLOOD_STREAM_RED 70
new const g_item_name[] = { "Blood Stone" }; // Item name
new const g_item_cost = 10 ; // Item cost
new const sound_buy[] = { "items/gunpickup2.wav" } // Sound Buy
new const sound_miss[] = { "zombie_plague/bloodstone_miss.wav" }
new const sound_blood_start[] = { "zombie_plague/bloodstone_start.wav" }
new const sound_blood_end[] = { "zombie_plague/bloodstone_end.wav" }
new SayText
new g_item_blood, gMsgScreenFade, g_blood_type, g_blood_num, g_blood_dist, g_blood_time, g_blood_remove, g_blood_health, g_blood_cdown, g_blood_infect, g_True
new g_blood_wintype, g_blood_give, g_BloodNum[32], g_Times[33]
new Float:g_Bloodtime[32]
new bool:g_item[33], g_Number[33], g_CoolDown[33], g_Blood[33], g_ability[33], g_ShowHud[33], g_Death[33]
public plugin_init()
{
g_blood_type = register_cvar("zp_bloodstone_bind_type", "1") // 0 - Binded bloodstone, 1 - bind B.
g_blood_num = register_cvar("zp_bloodstone_number", "10") // Number use ability, 0 - Unlimited
g_blood_dist = register_cvar("zp_bloodstone_dist", "620.0") // Distance ability
g_blood_time = register_cvar("zp_bloodstone_time", "12.0") // Time is activite ability
g_blood_remove = register_cvar("zp_bloodstone_remove", "0.1") // Every second in cvar zp_bloodstone_health
g_blood_health = register_cvar("zp_bloodstone_health", "2") // Health in cvar zp_bloodstone_remove, if human is going
g_blood_cdown = register_cvar("zp_bloodstone_cdown", "5.0") // cooldown ability
g_blood_infect = register_cvar("zp_bloodstone_infection", "0") // If in human health < 1; 0 - Death human, 1 - Infection human.
g_blood_wintype = register_cvar("zp_bloodstone_wintype", "1") // 1 - Give Health, if human death, 0 - ammo packs
g_blood_give = register_cvar("zp_bloodstone_gives", "5") // Give X health/ammopacks
g_item_blood = zv_register_extra_item(g_item_name, "Blood", g_item_cost, ZP_TEAM_ZOMBIE)
register_clcmd("bloodstone", "cmd_Blood")
register_event("StatusValue","show_status","be","1=2","2!0")
register_event("StatusValue","hide_status","be","1=1","2=0")
set_task(1.0,"event_blood",100,"",0,"b")
gMsgScreenFade = get_user_msgid("ScreenFade")
register_event("DeathMsg", "DeathZombie", "a")
register_event("HLTV", "round_start", "a", "1=0", "2=0")
register_plugin(PLUGIN, VERSION, AUTHOR)
SayText = get_user_msgid("SayText")
register_dictionary("zp_extra_bloodstone.txt")
}
public plugin_precache()
{
precache_sound( sound_buy )
precache_sound( sound_miss )
precache_sound( sound_blood_start )
precache_sound( sound_blood_end )
}
public DeathZombie()
{
new id = read_data(2)
g_item[id] = false;
g_ability[id] = false;
g_Number[id] = false;
}
public client_putinserver(id)
g_Number[id] = false;
public zv_extra_item_selected(id, item)
{
if ( item == g_item_blood )
{
if( !g_Number[id] && !zp_is_survivor_round() && zp_get_user_zombie(id) && !zp_is_nemesis_round() )
{
g_item[id] = true;
emit_sound(id, CHAN_STREAM, sound_buy, 1.0, ATTN_NORM, 0, PITCH_HIGH )
g_BloodNum[id] = get_pcvar_num(g_blood_num);
g_CoolDown[id] = true;
if( get_pcvar_num(g_blood_type) == 1)
{
ChatColor(id, "!g[ZP]!y %L", LANG_PLAYER, "BLOOD_BUY", g_BloodNum[id])
client_cmd(id, "bind b bloodstone")
}
else
ChatColor(id, "!g[ZP]!y %L", LANG_PLAYER, "BLOOD_NOBIND", g_BloodNum[id])
g_Number[id] = true;
set_task(1.0, "ShowHud", id, _, _, "b")
}
else
{
g_Number[id] = true;
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + g_item_cost)
ChatColor(id, "!g[ZP]!y %L", LANG_PLAYER, "BLOOD_BOUTH")
}
}
}
public ShowHud(id)
{
if( g_item[id] && zp_get_user_zombie(id) && is_user_alive(id) && (g_BloodNum[id] > 0) )
{
set_hudmessage(200, 70, 0, 0.45, 0.8, 0, 1.0, 1.0, 0.0, 0.0, -1)
show_hudmessage(id, "%L", LANG_PLAYER, "BLOODSTONES", g_BloodNum[id]);
}
else
remove_task(id)
}
public zp_user_infected_post(id, infector)
{
g_item[id] = false;
g_ability[id] = false;
g_Number[id] = false;
}
public cmd_Blood(id)
{
if( g_item[id] && zp_get_user_zombie(id) && !zp_is_survivor_round() && g_CoolDown[id] && is_user_alive(id))
{
if(g_BloodNum[id] > 0)
{
g_BloodNum[id] = g_BloodNum[id] - 1;
ChatColor(id, "!g[ZP] !y%L", LANG_PLAYER, "NUMBER_BLOOD", g_BloodNum[id])
set_task(0.1, "BloodStone_Active", id)
}
else
{
g_Number[id] = false;
ChatColor(id, "!g[ZP] !y%L", LANG_PLAYER, "DONT_BLOOD")
}
}
}
public BloodStone_Active(id)
{
new target, body,dist; dist = get_pcvar_num(g_blood_dist)
get_user_aiming(id, target, body, dist)
g_True = 0;
if(!target)
{
g_CoolDown[id] = false;
set_task(get_pcvar_float(g_blood_cdown), "Reset_CoolDown", id)
emit_sound(target, CHAN_STREAM, sound_miss, 1.0, ATTN_NORM, 0, PITCH_HIGH )
}
else
{
if( is_valid_ent( target ) && !zp_get_user_zombie(target) && is_user_alive(target) && (get_entity_distance( id, target ) <= dist) && g_CoolDown[id])
{
emit_sound(target, CHAN_STREAM, sound_blood_start, 1.0, ATTN_NORM, 0, PITCH_HIGH )
g_Blood[target] = true; g_CoolDown[id] = false; g_ability[id] = true; g_ShowHud[id] = true;
g_Bloodtime[target] = get_pcvar_float(g_blood_time);
g_Times[id] = get_pcvar_num(g_blood_time);
set_task(get_pcvar_float(g_blood_time), "Win_False", id);
set_task(get_pcvar_float(g_blood_cdown) + g_Bloodtime[target], "Reset_CoolDown", id)
set_task(get_pcvar_float(g_blood_remove), "Human_Bloodes", target)
set_task(1.0, "Human_Distance", id, _, _, "a", g_Times[id])
}
}
}
public Human_Distance(id)
{
new Float:origin_id[3], Float:origin_2[3]
pev(id, pev_origin, origin_id)
g_Times[id] = g_Times[id] - 1;
if(g_True != 0)
{
g_True = 0;
if(get_pcvar_num(g_blood_infect) != 1)
ChatColor(id, "!g[ZP] !y%L", LANG_PLAYER, "DEAD_PLAYER")
else
ChatColor(id, "!g[ZP] !y%L", LANG_PLAYER, "INFECT_PLAYER")
Human_death(id)
remove_task(id)
}
for(new i=1;i<=32;i++)
{
pev(i,pev_origin,origin_2)
if( (vector_distance(origin_id,origin_2) != 0) && g_Death[i] )
{
g_True = 1;
g_Death[i] = false;
}
}
}
Human_death(id)
{
if( zp_get_user_zombie(id) && g_item[id])
{
g_ability[id] = false;
if(get_pcvar_num(g_blood_wintype) == 0)
{
zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + get_pcvar_num(g_blood_give))
ChatColor(id, "!g[ZP] !y%L", LANG_PLAYER, "WIN_AMMO")
}
else
{
fm_set_user_health(id, get_user_health(id) + get_pcvar_num(g_blood_give))
ChatColor(id, "!g[ZP] !y%L", LANG_PLAYER, "WIN_HEALTH")
message_begin(MSG_ONE_UNRELIABLE, gMsgScreenFade, {0, 0, 0}, id)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(200)
write_byte(40)
write_byte(0)
write_byte(20)
message_end()
}
}
}
public hide_status(id)
{
set_hudmessage(0,0,0,0.0,0.0,0, 0.0, 0.01, 0.0, 0.0, 4)
show_hudmessage(id,"")
}
public show_status(id)
{
new target = read_data(2)
if( zp_get_user_zombie(id) && !zp_get_user_zombie(target) && g_Blood[target] && g_item[id] )
{
set_hudmessage(200, 0, 0, 0.45, 0.8, 0, 1.0, 0.2, 0.0, 0.0, -1)
show_hudmessage(target, "Heath Victim: %d", get_user_health(target));
}
}
public Win_False(id)
{
g_ShowHud[id] = false;
g_ability[id] = false;
}
public Human_Bloodes(target)
{
if( (g_Bloodtime[target] > 0.1) && g_Blood[target] && !zp_get_user_zombie(target) )
{
set_hudmessage(200, 0, 0, 0.45, 0.8, 0, 1.0, 0.2, 0.0, 0.0, -1)
show_hudmessage(target, "%L", LANG_PLAYER, "HUD_VICTIM");
fm_set_rendering( target, kRenderFxGlowShell, 200, 0, 0, kRenderNormal, 16 )
g_Bloodtime[target] = g_Bloodtime[target] - get_pcvar_float(g_blood_remove);
if(fm_get_speed(target) > 0)
{
if( get_user_health(target) > get_pcvar_num(g_blood_health) )
{
g_Death[target] = false;
fm_set_user_health(target, get_user_health(target) - get_pcvar_num(g_blood_health))
message_begin(MSG_ONE_UNRELIABLE, gMsgScreenFade, {0, 0, 0}, target)
write_short(1<<10)
write_short(1<<10)
write_short(0x0000)
write_byte(200)
write_byte(0)
write_byte(0)
write_byte(20)
message_end()
}
else
{
g_Death[target] = true;
if(get_pcvar_num(g_blood_infect) != 1)
user_kill(target)
else
zp_infect_user(target)
remove_task(target)
}
}
set_task(get_pcvar_float(g_blood_remove), "Human_Bloodes", target)
}
else
{
fm_set_rendering( target, 0, 0, 0, 0, kRenderNormal, 25 )
emit_sound(target, CHAN_STREAM, sound_blood_end, 1.0, ATTN_NORM, 0, PITCH_HIGH )
g_Blood[target] = false;
remove_task(target)
}
}
public Reset_CoolDown(id)
{
g_CoolDown[id] = true;
ChatColor(id, "!g[ZP] !y%L", LANG_PLAYER, "COOLDOWN")
}
public event_blood()
{
new id, iPlayers[MAX_PLAYERS], iNumPlayers, iOrigin[3]
get_players(iPlayers,iNumPlayers,"a")
for (new i = 0; i < iNumPlayers; i++)
{
id = iPlayers[i]
if ( g_Blood[id] )
{
get_origin_int(id, iOrigin)
fx_bleed(iOrigin)
}
}
}
fx_bleed(origin[3])
{
// Blood spray
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BLOODSTREAM)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2]+10)
write_coord(random_num(-360,360)) // x
write_coord(random_num(-360,360)) // y
write_coord(-10) // z
write_byte(BLOOD_STREAM_RED) // color
write_byte(random_num(50,100)) // speed
message_end()
}
public get_origin_int(index, origin[3])
{
new Float:FVec[3]
pev(index,pev_origin,FVec)
origin[0] = floatround(FVec[0])
origin[1] = floatround(FVec[1])
origin[2] = floatround(FVec[2])
return 1
}
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!t", "^3") // Team Color
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, SayText, _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}
public zp_round_ended(winteam)
{
for (new id; id <= 32; id++)
g_Blood[id] = false;
}
public round_start(id)
{
for (new id; id <= 32; id++)
{
g_item[id] = false;
g_ability[id] = false;
g_Number[id] = false;
}
}
Eroare la compilat : zp_extra_bloodstone.sma(1) : error 010: invalid function or declaration
Last edited by
AnAcKiNNN12345
on 10-03-2016, 14:55:03; edited 1 time in total
0
0
Back to top
AnAcKiNNN12345
[Mentally Stable]
Status: Offline
(since 30-01-2017 13:00)
Joined: 22 Feb 2015
Posts: 230
,
Topics: 42
Location:
Romania
Reputation:
104
Votes
: 4
Posted: 10-03-2016, 14:53:07
| Translate post to:
... (
Click for more languages
)
Up...nimeni?
#Intr-un sistem corupt, totul e posibil!
0
0
Back to top
Mihai94.
[Fondator ZP]
Status: Offline
(since 04-12-2019 07:04)
Joined: 20 Jan 2016
Posts: 1298
,
Topics: 159
Location:
Romania
Reputation:
191.6
Votes
: 88
Posted: 11-03-2016, 09:42:03
| Translate post to:
... (
Click for more languages
)
Plasma GUN
Spoiler:
#include < amxmodx >
#include < fakemeta >
#include <
cstrike
>
#include < hamsandwich >
#include < zombieplague >
#include <zmvip>
new const PLUGIN_VERSION[ ] = "1.0.0 FINAL";
const OFFSET_WEAPONOWNER = 41
const OFFSET_LINUX = 5
const OFFSET_LINUX_WEAPONS = 4
const WEAP_KEY = 545464464
const MAX_PLAYERS = 32
const m_flNextPrimaryAttack = 46;
const m_iClip = 51;
const m_flNextAttack = 83;
const m_flTimeWeaponIdle = 48;
const m_szAnimExtention = 492
enum ( <<=1 )
{
DROP_PRIMARY = 1,
DROP_SECONDARY
};
const IDLE = 0
const RELOAD = 1
const DRAW = 2
const SHOOT_1 = 3
const SHOOT_END = 4
#define HoldCBaseWeapon(%0) ( get_user_weapon( %0 ) == g_iWeaponID && g_pWeaponA[ %0 ] )
#define IsValidPrivateData(%0) ( pev_valid( %0 ) == 2 )
#define PRECACHE_MODEL(%0) engfunc(EngFunc_PrecacheModel, %0)
#define PRECACHE_SOUND(%0) engfunc(EngFunc_PrecacheSound, %0)
#define PRECACHE_GENERIC(%0) engfunc(EngFunc_PrecacheGeneric, %0)
new const WEAPON_SOUND_FIRE[ ] = "weapons/plasmagun-1.wav";
new const WEAPON_SOUND_BOMB[ ] = "weapons/plasmagun_exp.wav";
new const WEAPON_LIST[ ] = "weapon_plasmagun";
new const WEAPON_BASE_NAME[ ] = "weapon_m249";
const Float: RELOAD_TIME = 3.36 //????? ???????????
const AMMO__WEAPON = 200 //???-?? ??????
const CLIP__WEAPON = 45 //???-?? ??????
const BALL__SPEED = 2000 //????????
const Float: BALL__DAMAGE = 200.0 //????
const Float: BALL__RADIUS = 125.0 //??????
const Float: WEAPON__SPEED = 0.15 //???????? ??????
new const EXTRA_ITEM_NAME[ ] = "Plasma Rife"; //???????? ? Extra-Items
new V_MODEL[ ] = "models/v_plasmagun.mdl";
new P_MODEL[ ] = "models/p_plasmagun.mdl";
new W_MODEL[ ] = "models/w_plasmagun.mdl";
new R_MODEL[ ] = "sprites/plasmaball.spr";
new const HUD_SPRITES[ ] [ ] =
{
"sprites/640hud3.spr" ,
"sprites/640hud91.spr"
};
new g_iItem , g_iForwardIndex , g_iExpSprite ;
new g_pWeaponA[ MAX_PLAYERS + 1 ] ;
new g_iWeaponID = 0;
new const BALL__CLASSNAME[ ] = "zsClassBall";
const WEAPONS_PRIMARY_BITSUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90);
const WEAPONS_SECONDARY_BITSUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE);
public plugin_precache( )
{
PRECACHE_MODEL( V_MODEL );
PRECACHE_MODEL( P_MODEL );
PRECACHE_MODEL( W_MODEL );
PRECACHE_MODEL( R_MODEL );
PRECACHE_SOUNDS_FROM_MODEL( V_MODEL );
PRECACHE_SOUND( WEAPON_SOUND_BOMB );
PRECACHE_SOUND( WEAPON_SOUND_FIRE );
static iFile
for( iFile = 0 ; iFile < sizeof HUD_SPRITES; iFile++ )
{
PRECACHE_GENERIC( HUD_SPRITES[ iFile ] )
}
static szFile [ 128 ];
formatex ( szFile , charsmax( szFile ) , "sprites/%s.txt" , WEAPON_LIST );
PRECACHE_GENERIC( szFile );
g_iExpSprite = precache_model( "sprites/plasmabomb.spr" );
}
public plugin_init()
{
register_plugin( "[CSO] Extra Item PlasmaGun" , PLUGIN_VERSION , "Shurik07" );
register_clcmd( WEAPON_LIST, "weapon_hook_an" );
register_forward( FM_SetModel, "Forward_SetModel" , false );
register_forward( FM_UpdateClientData, "Forward_UpdateClientData" , true );
RegisterHam( Ham_Item_AddToPlayer, WEAPON_BASE_NAME, "CBaseWeapon__AddToPlayer__Post" , .Post = true );
RegisterHam( Ham_Item_Deploy, WEAPON_BASE_NAME , "CBaseWeapon__Deploy__Post", .Post = true );
RegisterHam( Ham_Weapon_PrimaryAttack, WEAPON_BASE_NAME, "CBaseWeapon__PrimaryAttack__Pre" , .Post = false );
RegisterHam( Ham_Item_PostFrame, WEAPON_BASE_NAME, "CBaseWeapon__PostFrame__Pre" , .Post = false );
RegisterHam( Ham_Weapon_Reload, WEAPON_BASE_NAME, "CBaseWeapon__Reload_Pre" , .Post = false );
RegisterHam( Ham_Weapon_WeaponIdle, WEAPON_BASE_NAME, "CBaseWeapon__Idle_Pre", false );
RegisterHam( Ham_TraceAttack, "player", "CBase__TraceAttack_Pre", false );
register_forward( FM_Touch , "Forward_Touch" );
g_iItem = zv_register_extra_item( EXTRA_ITEM_NAME, "Arma Cu Plasma", 25, ZV_TEAM_HUMAN );
g_iWeaponID = get_weaponid( WEAPON_BASE_NAME );
}
public zv_extra_item_selected( pPlayer , pItem )
{
if( pItem == g_iItem )
{
UTIL__DropWeapons( pPlayer, DROP_PRIMARY )
g_pWeaponA[ pPlayer ] = true;
static pEntity;
pEntity = fm_give_item( pPlayer , WEAPON_BASE_NAME );
if( pEntity > 0 ) cs_set_weapon_ammo( pEntity, CLIP__WEAPON );
cs_set_user_bpammo( pPlayer , g_iWeaponID , AMMO__WEAPON );
UTIL__WeaponList( pPlayer, WEAPON_LIST , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 );
}
}
public weapon_hook_an( pPlayer )
{
engclient_cmd( pPlayer, WEAPON_BASE_NAME);
return PLUGIN_HANDLED;
}
public zp_user_humanized_post( pPlayer )
{
g_pWeaponA[ pPlayer ] = false;
}
public client_disconnect( pPlayer )
{
g_pWeaponA[ pPlayer ] = false;
}
public Forward_SetModel( pEntity, const pModel[ ] )
{
if( !pev_valid( pEntity ) )
{
return FMRES_IGNORED;
}
static szClassName [ 33 ]
pev( pEntity, pev_classname, szClassName, charsmax(szClassName) );
if( !equal ( szClassName, "weaponbox" ) )
{
return FMRES_IGNORED;
}
static pOwner , pModel
pModel = fm_find_ent_by_owner ( -1, WEAPON_BASE_NAME, pEntity );
pOwner = pev ( pEntity, pev_owner );
if ( g_pWeaponA [ pOwner ] && pev_valid ( pModel ) )
{
set_pev( pModel , pev_impulse , WEAP_KEY );
engfunc( EngFunc_SetModel, pEntity, W_MODEL );
g_pWeaponA [ pOwner ] = false;
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public Forward_UpdateClientData( pPlayer , SendWeapons, CD_Handle )
{
if ( !HoldCBaseWeapon( pPlayer ) )
{
return HAM_IGNORED;
}
static Float:fGametime;
fGametime = get_gametime( );
set_cd ( CD_Handle, CD_flNextAttack, fGametime + 0.001 );
return FMRES_HANDLED;
}
public Forward_PlayBackEvent(flags, invoker, eventindex, Float:delay, Float:origin[3], Float:fvangles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
return FMRES_SUPERCEDE
}
public CBaseWeapon__AddToPlayer__Post( pEntity , pPlayer )
{
if( !pev_valid( pEntity ) && !is_user_connected( pPlayer ) )
{
return HAM_IGNORED;
}
if( pev( pEntity, pev_impulse) == WEAP_KEY )
{
g_pWeaponA[ pPlayer ] = true;
UTIL__WeaponList( pPlayer, WEAPON_LIST , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 );
return HAM_IGNORED ;
}
else
{
UTIL__WeaponList( pPlayer, WEAPON_BASE_NAME , 3 , AMMO__WEAPON , -1 , -1 , 0 , 4 , g_iWeaponID , 0 )
}
return HAM_IGNORED;
}
public CBaseWeapon__Deploy__Post( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
if ( !g_pWeaponA[ pId ] )
{
return HAM_IGNORED;
}
set_pev( pId, pev_viewmodel2, V_MODEL);
set_pev( pId, pev_weaponmodel2, P_MODEL);
set_pdata_float( pId, m_flNextAttack, 1.0, OFFSET_LINUX );
set_pdata_float( pEntity, m_flTimeWeaponIdle, 1.0 , OFFSET_LINUX_WEAPONS );
set_pdata_string( pId, m_szAnimExtention * 4, "rifle" , -1, OFFSET_LINUX * 4);
UTIL_SenwWeaponAnim( pId, DRAW );
return HAM_IGNORED ;
}
public CBaseWeapon__PrimaryAttack__Pre(pEntity)
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId ; pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX_WEAPONS );
static Float: vecPuncheAngle[ 3 ];
if ( !HoldCBaseWeapon( pId ) || iClip <= 0 )
{
return HAM_IGNORED;
}
g_iForwardIndex = register_forward( FM_PlaybackEvent, "Forward_PlayBackEvent" , false )
pev(pId, pev_punchangle, vecPuncheAngle);
ExecuteHam(Ham_Weapon_PrimaryAttack, pEntity);
set_pev(pId, pev_punchangle, Float:{ -5.0, 0.0, 0.0 });
Ball__Create( pId )
emit_sound( pId, CHAN_WEAPON, WEAPON_SOUND_FIRE, VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
UTIL_SenwWeaponAnim( pId, SHOOT_1 );
set_pdata_float( pEntity, m_flNextPrimaryAttack , WEAPON__SPEED , OFFSET_LINUX_WEAPONS );
set_pdata_float( pEntity, m_flTimeWeaponIdle, WEAPON__SPEED + 3.0 , OFFSET_LINUX_WEAPONS );
unregister_forward(FM_PlaybackEvent, g_iForwardIndex , false);
return HAM_SUPERCEDE;
}
Ball__Create ( const pId )
{
static pEntity;
if ( ( pEntity = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "env_sprite") ) ) )
{
static Float:vf_vOrigin[ 3 ] , Float: vf_vAngle[ 3 ];
engfunc( EngFunc_GetAttachment , pId , 1 , vf_vOrigin , vf_vAngle )
set_pev ( pEntity, pev_classname , BALL__CLASSNAME );
set_pev ( pEntity, pev_movetype, MOVETYPE_FLY );
set_pev ( pEntity, pev_solid, SOLID_SLIDEBOX );
engfunc ( EngFunc_SetModel , pEntity, R_MODEL );
engfunc ( EngFunc_SetOrigin, pEntity, vf_vOrigin );
engfunc ( EngFunc_SetSize , pEntity, Float:{ 0.0, 0.0, 0.0 }, Float:{ 0.0, 0.0, 0.0 } );
set_pev ( pEntity, pev_renderfx, kRenderFxGlowShell );
set_pev ( pEntity, pev_rendermode, kRenderTransAdd );
set_pev ( pEntity, pev_renderamt, 255.0 )
set_pev ( pEntity, pev_scale , random_float( random_float( 0.1 , 0.2 ) , random_float( 0.3 , 0.4 ) ) );
set_pev ( pEntity, pev_iuser1 , pId );
static Float:vf_vVelocity[ 3 ];
velocity_by_aim( pId, BALL__SPEED, vf_vVelocity );
set_pev( pEntity, pev_velocity, vf_vVelocity );
static Float:vf_vAngles[ 3 ];
engfunc( EngFunc_VecToAngles, vf_vVelocity, vf_vAngles );
set_pev( pEntity, pev_angles, vf_vAngles );
}
}
public CBaseWeapon__PostFrame__Pre( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
if ( !is_user_connected( pId ) && !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
static fInReload ; fInReload = get_pdata_int( pEntity, 54, OFFSET_LINUX_WEAPONS );
static Float:flNextAttack ; flNextAttack = get_pdata_float( pId, m_flNextAttack, OFFSET_LINUX_WEAPONS );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX_WEAPONS );
static iAmmoType ; iAmmoType = 376 + get_pdata_int( pEntity, 49, OFFSET_LINUX_WEAPONS );
static iBpAmmo ; iBpAmmo = get_pdata_int( pId, iAmmoType, OFFSET_LINUX );
if ( fInReload && flNextAttack <= RELOAD_TIME )
{
static j ; j = min( CLIP__WEAPON - iClip, iBpAmmo);
set_pdata_int( pEntity, m_iClip, iClip + j, OFFSET_LINUX_WEAPONS );
set_pdata_int( pId, iAmmoType, iBpAmmo-j, OFFSET_LINUX );
set_pdata_int( pEntity, 54, 0, OFFSET_LINUX_WEAPONS );
}
return HAM_IGNORED;
}
public CBaseWeapon__Reload_Pre(pEntity)
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
static iAmmoType ; iAmmoType = 376 + get_pdata_int( pEntity, 49, OFFSET_LINUX_WEAPONS );
static iBpAmmo ; iBpAmmo = get_pdata_int( pId, iAmmoType, OFFSET_LINUX );
static iClip ; iClip = get_pdata_int( pEntity, m_iClip, OFFSET_LINUX );
if ( iBpAmmo <= 0 || iClip >= CLIP__WEAPON )
{
return HAM_SUPERCEDE;
}
set_pdata_int( pEntity, m_iClip, 0, OFFSET_LINUX_WEAPONS );
ExecuteHam( Ham_Weapon_Reload, pEntity );
set_pdata_int( pEntity, m_iClip, iClip, OFFSET_LINUX_WEAPONS );
if ( !is_user_connected( pId ) || !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
set_pdata_float( pId, m_flNextAttack, RELOAD_TIME , OFFSET_LINUX);
set_pdata_float( pEntity, m_flTimeWeaponIdle, RELOAD_TIME , OFFSET_LINUX_WEAPONS );
UTIL_SenwWeaponAnim(pId, RELOAD);
return HAM_SUPERCEDE;
}
public CBaseWeapon__Idle_Pre( pEntity )
{
if( !IsValidPrivateData( pEntity ) )
{
return HAM_IGNORED;
}
static pId;
pId = get_pdata_cbase( pEntity , OFFSET_WEAPONOWNER , OFFSET_LINUX_WEAPONS );
ExecuteHamB( Ham_Weapon_ResetEmptySound, pEntity );
if (get_pdata_int(pEntity, m_flTimeWeaponIdle, OFFSET_LINUX_WEAPONS) > 0.0)
{
return HAM_IGNORED;
}
if ( !HoldCBaseWeapon( pId ) )
{
return HAM_IGNORED;
}
UTIL_SenwWeaponAnim ( pId, IDLE );
set_pdata_float( pEntity, m_flTimeWeaponIdle, random_float( 5.0 , 15.0 ) , OFFSET_LINUX_WEAPONS );
return HAM_SUPERCEDE;
}
public CBase__TraceAttack_Pre(const iEntity, const iAttacker, const Float: flDamage)
{
if ( is_user_connected( iAttacker ) && HoldCBaseWeapon( iAttacker ) )
{
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public Forward_Touch( const pEntity , const i_Other )
{
if( !pev_valid( pEntity ) )
{
return FMRES_IGNORED ;
}
static g_classname[ 32 ] ;
pev( pEntity, pev_classname, g_classname, 31 )
if( equali( g_classname, BALL__CLASSNAME ) )
{
static Float:flOrigin[ 3 ];
pev( pEntity, pev_origin, flOrigin );
engfunc( EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flOrigin, 0 );
write_byte( TE_EXPLOSION );
engfunc( EngFunc_WriteCoord, flOrigin[ 0 ] );
engfunc( EngFunc_WriteCoord, flOrigin[ 1 ] );
engfunc( EngFunc_WriteCoord, flOrigin[ 2 ] );
write_short( g_iExpSprite );
write_byte( 5 );
write_byte( 15 );
write_byte( TE_EXPLFLAG_NOPARTICLES | TE_EXPLFLAG_NOSOUND );
message_end( );
emit_sound( pEntity, CHAN_WEAPON, WEAPON_SOUND_BOMB , VOL_NORM, ATTN_NORM, 0, PITCH_NORM );
static pOwner , pevVictim ;
pOwner = pev( pEntity, pev_iuser1 ); pevVictim = -1;
while( ( pevVictim = engfunc( EngFunc_FindEntityInSphere, pevVictim, flOrigin, BALL__RADIUS) ) != 0 )
{
if( !is_user_alive( pevVictim ) )
continue;
if( !zp_get_user_zombie( pevVictim ) )
continue;
ExecuteHamB( Ham_TakeDamage, pevVictim, pEntity, pOwner, BALL__DAMAGE, DMG_SONIC );
}
engfunc( EngFunc_RemoveEntity , pEntity );
}
return FMRES_IGNORED ;
}
stock UTIL__DropWeapons(id, bitsDropType)
{
static weapons[32], num, i, weaponid
num = 0
get_user_weapons(id, weapons, num)
for (i = 0; i < num; i++)
{
weaponid = weapons[i]
if ((bitsDropType == DROP_PRIMARY && ((1<<weaponid) & WEAPONS_PRIMARY_BITSUM)) || (bitsDropType == DROP_SECONDARY && ((1<<weaponid) & WEAPONS_SECONDARY_BITSUM)))
{
static wname[32]
get_weaponname(weaponid, wname, charsmax(wname))
engclient_cmd(id, "drop", wname)
}
}
}
stock fm_find_ent_by_owner(entity, const classname[], owner)
{
while ((entity = engfunc(EngFunc_FindEntityByString, entity, "classname", classname)) && pev(entity, pev_owner) != owner) { /* keep looping */ }
return entity;
}
stock UTIL_SenwWeaponAnim(const pPlayer, const Sequence)
{
set_pev(pPlayer, pev_weaponanim, Sequence)
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = pPlayer)
write_byte(Sequence)
write_byte(pev(pPlayer, pev_body))
message_end()
}
UTIL__WeaponList( pPlayer, const szWeapon[ ], int, int2, int3, int4, int5, int6, int7, int8 )
{
message_begin( MSG_ONE, get_user_msgid( "WeaponList" ) , _, pPlayer );
write_string( szWeapon );
write_byte( int );
write_byte( int2);
write_byte( int3 );
write_byte( int4 );
write_byte( int5 );
write_byte( int6 );
write_byte( int7 );
write_byte( int8 );
message_end( );
}
stock fm_give_item(id, const item[])
{
static ent
ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item))
if (!pev_valid(ent)) return 0;
static Float:originF[3]
pev(id, pev_origin, originF)
set_pev(ent, pev_origin, originF)
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN)
dllfunc(DLLFunc_Spawn, ent)
static save
save = pev(ent, pev_solid)
dllfunc(DLLFunc_Touch, ent, id)
if (pev(ent, pev_solid) != save)
return ent ;
engfunc(EngFunc_RemoveEntity, ent)
return -1;
}
PRECACHE_SOUNDS_FROM_MODEL(const szModelPath[])
{
new iFile;
if ((iFile = fopen(szModelPath, "rt")))
{
new szSoundPath[64];
new iNumSeq, iSeqIndex;
new iEvent, iNumEvents, iEventIndex;
fseek(iFile, 164, SEEK_SET);
fread(iFile, iNumSeq, BLOCK_INT);
fread(iFile, iSeqIndex, BLOCK_INT);
for (new k, i = 0; i < iNumSeq; i++)
{
fseek(iFile, iSeqIndex + 48 + 176 * i, SEEK_SET);
fread(iFile, iNumEvents, BLOCK_INT);
fread(iFile, iEventIndex, BLOCK_INT);
fseek(iFile, iEventIndex + 176 * i, SEEK_SET);
for (k = 0; k < iNumEvents; k++)
{
fseek(iFile, iEventIndex + 4 + 76 * k, SEEK_SET);
fread(iFile, iEvent, BLOCK_INT);
fseek(iFile, 4, SEEK_CUR);
if (iEvent != 5004)
{
continue;
}
fread_blocks(iFile, szSoundPath, 64, BLOCK_CHAR);
if (strlen(szSoundPath))
{
strtolower(szSoundPath);
PRECACHE_SOUND(szSoundPath);
}
}
}
}
fclose(iFile);
}
modifici tu
dmg
si cat ammo sa coste arma este trecut cu rosu
ethereal numele si cat ammo sa coste arma modifici ce e cu rosu
Spoiler:
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <cstrike>
#include <fakemeta>
#include <hamsandwich>
#include <zombieplague>
#include <zmvip>
#define ITEM_NAME "[ZP] Ethereal"
#define ITEM_NAME2 "Arma Laser"
#define ITEM_COST 40
#define WEAPON_BITSUM ((1<<CSW_SCOUT) | (1<<CSW_XM1014) | (1<<CSW_MAC10) | (1<<CSW_AUG) | (1<<CSW_UMP45) | (1<<CSW_SG550) | (1<<CSW_UMP45) | (1<<CSW_FAMAS) | (1<<CSW_AWP) | (1<<CSW_MP5NAVY) | (1<<CSW_M249) | (1<<CSW_M3) | (1<<CSW_M4A1) | (1<<CSW_TMP) | (1<<CSW_G3SG1) | (1<<CSW_SG552) | (1<<CSW_AK47) | (1<<CSW_P90))
new const VERSION[] = "1.3";
new g_clipammo[33], g_has_balrog[33], g_itemid, g_hamczbots, g_laserbeam_spr, g_event_balrog, g_primaryattack, cvar_balrog_damage_x, cvar_balrog_bpammo, cvar_balrog_shotspd, cvar_balrog_oneround, cvar_balrog_clip, cvar_botquota;
new const SHOT_SOUND[][] = {"weapons/ethereal-1.wav"}
new const BALROG_SOUNDS[][] = {"weapon_ump45"}
new const GUNSHOT_DECALS[] = {41, 42, 43, 44, 45}
new const V_BALROG_MDL[64] = "models/v_ethereal.mdl";
new const P_BALROG_MDL[64] = "models/p_ethereal.mdl";
new const W_BALROG_MDL[64] = "models/w_ethereal.mdl";
public plugin_init()
{
// Plugin Register
register_plugin("[ZP:44] Extra Item: Balrog Ethereal", VERSION, "CrazY");
// Extra Item Register
g_itemid = zv_register_extra_item(ITEM_NAME, ITEM_NAME2, ITEM_COST, ZV_TEAM_HUMAN);
// Cvars Register
cvar_balrog_damage_x = register_cvar("zp_balrog_damage_x", "3.0");
cvar_balrog_clip = register_cvar("zp_balrog_clip", "40");
cvar_balrog_bpammo = register_cvar("zp_balrog_bpammo", "200");
cvar_balrog_shotspd = register_cvar("zp_balrog_shot_speed", "0.11");
cvar_balrog_oneround = register_cvar("zp_balrog_oneround", "0");
// Cvar Pointer
cvar_botquota = get_cvar_pointer("bot_quota");
// Admin command
register_concmd("zp_give_balrog", "cmd_give_balrog", 0);
// Events
register_event("HLTV", "event_round_start", "a", "1=0", "2=0");
// Forwards
register_forward(FM_UpdateClientData, "fw_UpdateClientData_Post", 1);
register_forward(FM_PrecacheEvent, "fw_PrecacheEvent_Post", 1)
register_forward(FM_PlaybackEvent, "fw_PlaybackEvent");
register_forward(FM_SetModel, "fw_SetModel");
// HAM Forwards
RegisterHam(Ham_Item_PostFrame, "weapon_ump45", "fw_ItemPostFrame");
RegisterHam(Ham_TraceAttack, "worldspawn", "fw_TraceAttack");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_ump45", "fw_PrimaryAttack");
RegisterHam(Ham_Weapon_PrimaryAttack, "weapon_ump45", "fw_PrimaryAttack_Post", 1);
RegisterHam(Ham_Item_Deploy, "weapon_ump45", "fw_ItemDeploy_Post", 1);
RegisterHam(Ham_TakeDamage, "player", "fw_TakeDamage");
RegisterHam(Ham_Item_AddToPlayer, "weapon_ump45", "fw_AddToPlayer");
}
public plugin_precache()
{
precache_model(V_BALROG_MDL);
precache_model(P_BALROG_MDL);
precache_model(W_BALROG_MDL);
g_laserbeam_spr = precache_model("sprites/laserbeam.spr");
for(new i = 0; i < sizeof SHOT_SOUND; i++) precache_sound(SHOT_SOUND[i]);
for(new i = 0; i < sizeof BALROG_SOUNDS; i++) precache_sound(BALROG_SOUNDS[i]);
}
public client_disconnect(id)
{
g_has_balrog[id] = false;
}
public client_connect(id)
{
g_has_balrog[id] = false;
}
public zp_user_humanized_post(id, human)
{
g_has_balrog[id] = false;
}
public zp_user_infected_post(id)
{
g_has_balrog[id] = false;
}
public client_putinserver(id)
{
g_has_balrog[id] = false;
if (is_user_bot(id) && !g_hamczbots && cvar_botquota)
{
set_task(0.1, "register_ham_czbots", id);
}
}
public event_round_start()
{
if (get_pcvar_num(cvar_balrog_oneround))
for (new i = 1; i <= get_maxplayers(); i++) g_has_balrog[i] = false;
}
public register_ham_czbots(id)
{
if (g_hamczbots || !is_user_bot(id) || !get_pcvar_num(cvar_botquota))
return;
RegisterHamFromEntity(Ham_TakeDamage, id, "fw_TakeDamage");
g_hamczbots = true;
}
public zv_extra_item_selected(player, itemid)
{
if (itemid == g_itemid)
{
client_print(player, print_chat, "[ZP] You bought %s.", ITEM_NAME);
command_give_balrog(player);
}
}
public cmd_give_balrog(id, level, cid)
{
if((get_user_flags(id) & level) != level)
{
return PLUGIN_HANDLED;
}
static arg[32], player;
read_argv(1, arg, charsmax(arg));
player = cmd_target(id, arg, (CMDTARGET_ONLY_ALIVE | CMDTARGET_ALLOW_SELF));
if (!player) return PLUGIN_HANDLED;
client_print(player, print_chat, "[ZP] You won a %s.", ITEM_NAME);
command_give_balrog(player);
return PLUGIN_HANDLED;
}
public command_give_balrog(player)
{
drop_primary(player);
g_has_balrog[player] = true;
new weaponid = give_item(player, "weapon_ump45");
cs_set_weapon_ammo(weaponid, get_pcvar_num(cvar_balrog_clip));
cs_set_user_bpammo(player, CSW_UMP45, get_pcvar_num(cvar_balrog_bpammo));
}
public fw_UpdateClientData_Post(id, sendweapons, cd_handle)
{
if (is_user_alive(id) && get_user_weapon(id) == CSW_UMP45 && g_has_balrog[id])
{
set_cd(cd_handle, CD_flNextAttack, halflife_time () + 0.001);
}
}
public fw_PrecacheEvent_Post(type, const name[])
{
if (equal("events/ump45.sc", name))
{
g_event_balrog = get_orig_retval()
return FMRES_HANDLED;
}
return FMRES_IGNORED;
}
public fw_PlaybackEvent(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
if ((eventid != g_event_balrog) || !g_primaryattack)
return FMRES_IGNORED;
if (!(1 <= invoker <= get_maxplayers()))
return FMRES_IGNORED;
playback_event(flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2);
return FMRES_SUPERCEDE;
}
public fw_SetModel(entity, model[])
{
if(!pev_valid(entity) || !equal(model, "models/w_ump45.mdl")) return FMRES_IGNORED;
static szClassName[33]; pev(entity, pev_classname, szClassName, charsmax(szClassName))
if(!equal(szClassName, "weaponbox")) return FMRES_IGNORED;
static owner, wpn
owner = pev(entity, pev_owner)
wpn = find_ent_by_owner(-1, "weapon_ump45", entity)
if(g_has_balrog[owner] && pev_valid(wpn))
{
g_has_balrog[owner] = false;
set_pev(wpn, pev_impulse, 10992);
engfunc(EngFunc_SetModel, entity, W_BALROG_MDL);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}
public fw_AddToPlayer(wpn, id)
{
if(pev_valid(wpn) && is_user_connected(id) && pev(wpn, pev_impulse) == 10992)
{
g_has_balrog[id] = true;
set_pev(wpn, pev_impulse, 0);
return HAM_HANDLED;
}
return HAM_IGNORED;
}
public fw_ItemPostFrame(weapon_entity)
{
new id = pev(weapon_entity, pev_owner);
if(!g_has_balrog[id] || !is_user_connected(id) || !pev_valid(weapon_entity))
return HAM_IGNORED;
static iClipExtra; iClipExtra = get_pcvar_num(cvar_balrog_clip);
new Float:flNextAttack = get_pdata_float(id, 83, 5);
new iBpAmmo = cs_get_user_bpammo(id, CSW_UMP45);
new iClip = get_pdata_int(weapon_entity, 51, 4);
new fInReload = get_pdata_int(weapon_entity, 54, 4);
if(fInReload && flNextAttack <= 0.0)
{
new Clp = min(iClipExtra - iClip, iBpAmmo);
set_pdata_int(weapon_entity, 51, iClip + Clp, 4);
cs_set_user_bpammo(id, CSW_UMP45, iBpAmmo-Clp);
set_pdata_int(weapon_entity, 54, 0, 4);
fInReload = 0;
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
if (is_user_alive(iAttacker) && get_user_weapon(iAttacker) == CSW_UMP45 && g_has_balrog[iAttacker])
{
static Float:flEnd[3]
get_tr2(ptr, TR_vecEndPos, flEnd)
if(iEnt)
{
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_DECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
write_short(iEnt)
message_end()
} else {
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
message_end()
}
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_GUNSHOTDECAL)
engfunc(EngFunc_WriteCoord, flEnd[0])
engfunc(EngFunc_WriteCoord, flEnd[1])
engfunc(EngFunc_WriteCoord, flEnd[2])
write_short(iAttacker)
write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
message_end()
}
}
public fw_PrimaryAttack(weapon_entity)
{
new id = get_pdata_cbase(weapon_entity, 41, 4);
if (g_has_balrog[id])
{
g_clipammo[id] = cs_get_weapon_ammo(weapon_entity);
g_primaryattack = 1;
}
}
public fw_PrimaryAttack_Post(weapon_entity)
{
new id = get_pdata_cbase(weapon_entity, 41, 4);
if (g_has_balrog[id] && g_clipammo[id])
{
g_primaryattack = 0;
set_pdata_float(weapon_entity, 46, get_pcvar_float(cvar_balrog_shotspd), 4);
emit_sound(id, CHAN_WEAPON, SHOT_SOUND[random_num(0, sizeof SHOT_SOUND - 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
MAKE_LaserBeam(id, 7, 100, 0, 0);
UTIL_PlayWeaponAnimation(id, random_num(3, 5));
}
}
public fw_ItemDeploy_Post(weapon_entity)
{
static id; id = get_weapon_ent_owner(weapon_entity);
if (pev_valid(id) && g_has_balrog[id])
{
set_pev(id, pev_viewmodel2, V_BALROG_MDL);
set_pev(id, pev_weaponmodel2, P_BALROG_MDL);
}
}
public fw_TakeDamage(victim, inflictor, attacker, Float:damage)
{
if(is_user_alive(attacker) && get_user_weapon(attacker) == CSW_UMP45 && g_has_balrog[attacker])
{
SetHamParamFloat(4, damage * get_pcvar_float(cvar_balrog_damage_x));
}
}
stock MAKE_LaserBeam(id, Size, R, G, B)
{
static End[3]
get_user_origin(id, End, 3)
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte (TE_BEAMENTPOINT)
write_short( id |0x1000 )
write_coord(End[0])
write_coord(End[1])
write_coord(End[2])
write_short(g_laserbeam_spr)
write_byte(0)
write_byte(1)
write_byte(1)
write_byte(Size)
write_byte(4)
write_byte(R)
write_byte(G)
write_byte(B)
write_byte(255)
write_byte(0)
message_end()
}
stock UTIL_PlayWeaponAnimation(const Player, const Sequence)
{
set_pev(Player, pev_weaponanim, Sequence)
message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, .player = Player)
write_byte(Sequence)
write_byte(pev(Player, pev_body))
message_end()
}
stock get_weapon_ent_owner(ent)
{
return get_pdata_cbase(ent, 41, 4);
}
stock give_item(index, const item[])
{
if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
return 0;
new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, item));
if (!pev_valid(ent))
return 0;
new Float:origin[3];
pev(index, pev_origin, origin);
set_pev(ent, pev_origin, origin);
set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
dllfunc(DLLFunc_Spawn, ent);
new save = pev(ent, pev_solid);
dllfunc(DLLFunc_Touch, ent, index);
if (pev(ent, pev_solid) != save)
return ent;
engfunc(EngFunc_RemoveEntity, ent);
return -1;
}
stock drop_primary(id)
{
new weapons[32], num;
get_user_weapons(id, weapons, num);
for (new i = 0; i < num; i++)
{
if (WEAPON_BITSUM & (1<<weapons[i]))
{
static wname[32];
get_weaponname(weapons[i], wname, sizeof wname - 1);
engclient_cmd(id, "drop", wname);
}
}
}
iar clasele astea 2 de zm is pentru alt mod de zm (zombie_plague_special) daca vrei sa le faci pt VIP este pluginul asta facut de edy pe (zombie_plague) nu va merge clasele astea daca le faci pt VIP trebuie sa ai modul asta
detalii
0
0
Back to top
Topic locked
Topic is closed, you cannot post any messages in it anymore
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 16-12-2024, 17:56:46
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details