Замена спрайтов взрыва


Замена спрайтов взрыва

Статья по замене спрайта взрыва на зомби сервере

Замена спрайтов взрыва

Статья по замене спрайта взрыва на зомби сервере

Откриваєм исходник zombie_plague40.sma и ищем строчку
// Game vars
и добавляем следуещие

new model_w_holy[128] = \”models/zombie_plague/w_holybomb.mdl\”
new model_p_holy[128] = \”models/zombie_plague/p_holybomb.mdl\”
new const explore_holy[][] = \”weapons/holywater_explosion.wav\”
new holyexplore


должно получитса так

// Game vars
new model_w_holy[128] = \”models/zombie_plague/w_holybomb.mdl\”
new model_p_holy[128] = \”models/zombie_plague/p_holybomb.mdl\”
new const explore_holy[][] = \”weapons/holywater_explosion.wav\”
new holyexplore
new g_pluginenabled // ZP enabled
new g_newround // new round starting
теперъ перкешим наши спрайти модели и звуки
ищем
engfunc(EngFunc_PrecacheModel, model_vknife_admin_zombie)
после ние добавляем
engfunc(EngFunc_PrecacheModel, model_w_holy)
engfunc(EngFunc_PrecacheModel, model_p_holy)
precache_sound(\”weapons/holywater_pinpul.wav\”)
precache_sound(\”weapons/holywater_deploy.wav\”)
precache_sound(\”weapons/holywater_explosion.wav\”)
holyexplore = precache_model(\”sprites/holybomb_exp.spr\”);
должно пулучитса так
engfunc(EngFunc_PrecacheModel, model_vknife_human)
engfunc(EngFunc_PrecacheModel, model_vknife_nemesis)
engfunc(EngFunc_PrecacheModel, model_vm249_survivor)
engfunc(EngFunc_PrecacheModel, model_grenade_infect)
engfunc(EngFunc_PrecacheModel, model_grenade_fire)
engfunc(EngFunc_PrecacheModel, model_grenade_frost)
engfunc(EngFunc_PrecacheModel, model_grenade_flare)
engfunc(EngFunc_PrecacheModel, model_vknife_admin_human)
engfunc(EngFunc_PrecacheModel, model_vknife_admin_zombie)
engfunc(EngFunc_PrecacheModel, model_w_holy)
engfunc(EngFunc_PrecacheModel, model_p_holy)
precache_sound(\”weapons/holywater_pinpul.wav\”)
precache_sound(\”weapons/holywater_deploy.wav\”)
precache_sound(\”weapons/holywater_explosion.wav\”)
holyexplore = precache_model(\”sprites/holybomb_exp.spr\”);


далъше ищем
// Fire Grenade Explosion
заменяем fire_explode(ent) на fire_explode(ent, id)
ниже должно битъ следуещие

// Fire nade explode sound
static sound[64]
ArrayGetString(grenade_fire, random_num(0, ArraySize(grenade_fire) – 1), sound, charsmax(sound))
emit_sound(ent, CHAN_WEAPON, sound, 1.0, ATTN_NORM, 0, PITCH_NORM)


заменяем на

emit_sound(id, CHAN_WEAPON, explore_holy[0], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)


ищем

set_pev(id, pev_viewmodel2, model_grenade_fire)


нашли добавляем

set_pev(id, pev_weaponmodel2, model_p_holy)


ищем
// Fire Grenade: Fire Blast
видим

create_blast2(const Float:originF[3])

// Smallest ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+385.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(200) // red
write_byte(100) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()

// Medium ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+470.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(200) // red
write_byte(50) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()

// Largest ring
engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, originF, 0)
write_byte(TE_BEAMCYLINDER) // TE id
engfunc(EngFunc_WriteCoord, originF[0]) // x
engfunc(EngFunc_WriteCoord, originF[1]) // y
engfunc(EngFunc_WriteCoord, originF[2]) // z
engfunc(EngFunc_WriteCoord, originF[0]) // x axis
engfunc(EngFunc_WriteCoord, originF[1]) // y axis
engfunc(EngFunc_WriteCoord, originF[2]+555.0) // z axis
write_short(g_exploSpr) // sprite
write_byte(0) // startframe
write_byte(0) // framerate
write_byte(4) // life
write_byte(60) // width
write_byte(0) // noise
write_byte(200) // red
write_byte(0) // green
write_byte(0) // blue
write_byte(200) // brightness
write_byte(0) // speed
message_end()


заменяем на

// Fire Grenade: Fire Blast
create_blast2(const Float:origin[3])

message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
write_byte(TE_EXPLOSION); // TE_EXPLOSION
write_coord(floatround(origin[0])); // origin x
write_coord(floatround(origin[1])); // origin y
write_coord(floatround(origin[2])); // origin z
write_short(holyexplore); // sprites
write_byte(40); // scale in 0.1\’s
write_byte(30); // framerate
write_byte(TE_EXPLFLAG_NONE); // flags
message_end(); // message end


ищем
// Forward Set Model
заменяем ету функцию на

// Forward Set Model
public fw_SetModel(entity, const model[])

// We don\’t care
if (strlen(model) 0.0)

// Get entity\’s classname
static classname[10]
pev(entity, pev_classname, classname, charsmax(classname))

// Check if it\’s a weapon box
if (equal(classname, \”weaponbox\”))

// They get automatically removed when thinking
set_pev(entity, pev_nextthink, get_gametime() + get_pcvar_float(cvar_removedropped))
return FMRES_IGNORED;

// Narrow down our matches a bit
if (model[7] != \’w\’ || model[8] != \’_\’)
return FMRES_IGNORED

// Get damage time of grenade
static Float:dmgtime
pev(entity, pev_dmgtime, dmgtime)

// Grenade not yet thrown
if (dmgtime == 0.0)
return FMRES_IGNORED;

// Get whether grenade\’s owner is a zombie
if (g_zombie[pev(entity, pev_owner)])

if (model[9] == \’h\’ && model[10] == \’e\’ && get_pcvar_num(cvar_extrainfbomb)) // Infection Bomb

// Give it a glow
fm_set_rendering(entity, kRenderFxGlowShell, 0, 200, 0, kRenderNormal, 16);

// And a colored trail
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW) // TE id
write_short(entity) // entity
write_short(g_trailSpr) // sprite
write_byte(10) // life
write_byte(10) // width
write_byte(0) // r
write_byte(200) // g
write_byte(0) // b
write_byte(200) // brightness
message_end()

// Set grenade type on the thrown grenade entity
set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_INFECTION)
return FMRES_SUPERCEDE

else if (model[9] == \’h\’ && model[10] == \’e\’ && get_pcvar_num(cvar_firegrenades)) // Napalm Grenade

set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_NAPALM)

engfunc( EngFunc_SetModel, entity, model_w_holy)
return FMRES_SUPERCEDE

else if (model[9] == \’f\’ && model[10] == \’l\’ && get_pcvar_num(cvar_frostgrenades)) // Frost Grenade

// Give it a glow
fm_set_rendering(entity, kRenderFxGlowShell, 0, 100, 200, kRenderNormal, 16);

// And a colored trail
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW) // TE id
write_short(entity) // entity
write_short(g_trailSpr) // sprite
write_byte(10) // life
write_byte(10) // width
write_byte(0) // r
write_byte(100) // g
write_byte(200) // b
write_byte(200) // brightness
message_end()

// Set grenade type on the thrown grenade entity
set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FROST)
return FMRES_SUPERCEDE

else if (model[9] == \’s\’ && model[10] == \’m\’ && get_pcvar_num(cvar_flaregrenades)) // Flare

// Build flare\’s color
static rgb[3]
switch (get_pcvar_num(cvar_flarecolor))

case 0: // white

rgb[0] = 255 // r
rgb[1] = 255 // g
rgb[2] = 255 // b

case 1: // red

rgb[0] = random_num(50,255) // r
rgb[1] = 0 // g
rgb[2] = 0 // b

case 2: // green

rgb[0] = 0 // r
rgb[1] = random_num(50,255) // g
rgb[2] = 0 // b

case 3: // blue

rgb[0] = 0 // r
rgb[1] = 0 // g
rgb[2] = random_num(50,255) // b

case 4: // random (all colors)

rgb[0] = random_num(50,200) // r
rgb[1] = random_num(50,200) // g
rgb[2] = random_num(50,200) // b

case 5: // random (r,g,b)

switch (random_num(1, 3))

case 1: // red

rgb[0] = random_num(50,255) // r
rgb[1] = 0 // g
rgb[2] = 0 // b

case 2: // green

rgb[0] = 0 // r
rgb[1] = random_num(50,255) // g
rgb[2] = 0 // b

case 3: // blue

rgb[0] = 0 // r
rgb[1] = 0 // g
rgb[2] = random_num(50,255) // b

// Give it a glow
fm_set_rendering(entity, kRenderFxGlowShell, rgb[0], rgb[1], rgb[2], kRenderNormal, 16);

// And a colored trail
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW) // TE id
write_short(entity) // entity
write_short(g_trailSpr) // sprite
write_byte(10) // life
write_byte(10) // width
write_byte(rgb[0]) // r
write_byte(rgb[1]) // g
write_byte(rgb[2]) // b
write_byte(200) // brightness
message_end()

// Set grenade type on the thrown grenade entity
set_pev(entity, PEV_NADE_TYPE, NADE_TYPE_FLARE)

// Set flare color on the thrown grenade entity
set_pev(entity, PEV_FLARE_COLOR, rgb)
return FMRES_SUPERCEDE

return FMRES_IGNORED


ищем
case NADE_TYPE_NAPALM:
заменяем
fire_explode(entity) на fire_explode(entity, id)
више ищем

// Ham Grenade Think Forward
public fw_ThinkGrenade(entity)


и заменяем на

// Ham Grenade Think Forward
public fw_ThinkGrenade(entity, id)


если все зделано правилъно должно получитса так

Замена спрайтов взрыва

Замена спрайтов взрыва

Комментарии:


Рейтинг
( Пока оценок нет )
Понравилась статья? Поделиться с друзьями:
Zombie-Mod.com — крупнейший игровой портал по Counter Strike