[CS 1.6] Как добавить к гранатам спрайты/эффекты и вывести их в файл?
Делаем вывод новых спрайтов и эффектов для гранат на вашем зомби сервере
Работать мы будем в zombieplague40.sma
1) В начале исхода создаём переменные:
new g_fire_exp, g_fire_gibs
new g_frost_exp, g_frost_gibs
new g_inf_exp, g_inf_gibs
new sprite_g_fire_exp[64], sprite_g_fire_gibs[64]
new sprite_g_frost_exp[64], sprite_g_frost_gibs[64]
new sprite_g_inf_exp[64], sprite_g_inf_gibs[64]
2) Ищем plugin_precache и добавляем туда это:
g_fire_exp = engfunc(EngFunc_PrecacheModel, sprite_g_fire_exp)
g_fire_gibs = engfunc(EngFunc_PrecacheModel, sprite_g_fire_gibs)
g_frost_exp = engfunc(EngFunc_PrecacheModel, sprite_g_frost_exp)
g_frost_gibs = engfunc(EngFunc_PrecacheModel, sprite_g_frost_gibs)
g_inf_exp = engfunc(EngFunc_PrecacheModel, sprite_g_inf_exp)
g_inf_gibs = engfunc(EngFunc_PrecacheModel, sprite_g_inf_gibs)
engfunc(EngFunc_PrecacheModel, sprite_g_inf_gibs)
engfunc(EngFunc_PrecacheModel, sprite_g_inf_exp)
engfunc(EngFunc_PrecacheModel, sprite_g_frost_gibs)
engfunc(EngFunc_PrecacheModel, sprite_g_frost_exp)
engfunc(EngFunc_PrecacheModel, sprite_g_fire_gibs)
engfunc(EngFunc_PrecacheModel, sprite_g_fire_exp)
3) Ищем // Fire Grenade Explosion и добавляем после // Fire nade explode sound это:
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_EXPLOSION) // Temporary entity ID
engfunc(EngFunc_WriteCoord, originF[0]) // engfunc because float
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2] + 40)
write_short(g_fire_exp) // Sprite index
write_byte(13) // Scale
write_byte(18) // Framerate
write_byte(TE_EXPLFLAG_NOSOUND) // Flags
message_end()
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_SPRITETRAIL) // Throws a shower of sprites or models
engfunc(EngFunc_WriteCoord, originF[ 0 ]) // start pos
engfunc(EngFunc_WriteCoord, originF[ 1 ])
engfunc(EngFunc_WriteCoord, originF[ 2 ] + 200.0)
engfunc(EngFunc_WriteCoord, originF[ 0 ]) // velocity
engfunc(EngFunc_WriteCoord, originF[ 1 ])
engfunc(EngFunc_WriteCoord, originF[ 2 ] + 30.0)
write_short(g_fire_gibs) // spr
write_byte(30) // (count)
write_byte(5) // (life in 0.1's)
write_byte(2) // byte (scale in 0.1's)
write_byte(50) // (velocity along vector in 10's)
write_byte(10) // (randomness of velocity in 10's)
message_end()
4) Ищем // Infection Bomb Explosion и добавляем после // Infection nade explode sound это:
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_EXPLOSION) // Temporary entity ID
engfunc(EngFunc_WriteCoord, originF[0]) // engfunc because float
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2] + 40)
write_short(g_inf_exp) // Sprite index
write_byte(13) // Scale
write_byte(18) // Framerate
write_byte(TE_EXPLFLAG_NOSOUND) // Flags
message_end()
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_SPRITETRAIL) // Throws a shower of sprites or models
engfunc(EngFunc_WriteCoord, originF[ 0 ]) // start pos
engfunc(EngFunc_WriteCoord, originF[ 1 ])
engfunc(EngFunc_WriteCoord, originF[ 2 ] + 200.0)
engfunc(EngFunc_WriteCoord, originF[ 0 ]) // velocity
engfunc(EngFunc_WriteCoord, originF[ 1 ])
engfunc(EngFunc_WriteCoord, originF[ 2 ] + 30.0)
write_short(g_inf_gibs) // spr
write_byte(30) // (count)
write_byte(5) // (life in 0.1's)
write_byte(2) // byte (scale in 0.1's)
write_byte(50) // (velocity along vector in 10's)
write_byte(10) // (randomness of velocity in 10's)
message_end()
5) Ищем // Frost Grenade Explosion и добавляем после // Frost nade explode sound sound это:
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_EXPLOSION) // Temporary entity ID
engfunc(EngFunc_WriteCoord, originF[0]) // engfunc because float
engfunc(EngFunc_WriteCoord, originF[1])
engfunc(EngFunc_WriteCoord, originF[2] + 40)
write_short(g_frost_exp) // Sprite index
write_byte(13) // Scale
write_byte(18) // Framerate
write_byte(TE_EXPLFLAG_NOSOUND) // Flags
message_end()
message_begin (MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_SPRITETRAIL) // Throws a shower of sprites or models
engfunc(EngFunc_WriteCoord, originF[ 0 ]) // start pos
engfunc(EngFunc_WriteCoord, originF[ 1 ])
engfunc(EngFunc_WriteCoord, originF[ 2 ] + 200.0)
engfunc(EngFunc_WriteCoord, originF[ 0 ]) // velocity
engfunc(EngFunc_WriteCoord, originF[ 1 ])
engfunc(EngFunc_WriteCoord, originF[ 2 ] + 30.0)
write_short(g_frost_gibs) // spr
write_byte(30) // (count)
write_byte(5) // (life in 0.1's)
write_byte(2) // byte (scale in 0.1's)
write_byte(50) // (velocity along vector in 10's)
write_byte(10) // (randomness of velocity in 10's)
message_end()
Спрайты к гранам добавлены, осталось лишь вывести их в
zombieplague.iniИщем:
case SECTION_GRENADE_SPRITES:
Добавляем туда это:
else if (equal(key, "EXPLODEFIRE"))
copy(sprite_g_fire_exp, charsmax(sprite_g_fire_exp), value)
else if (equal(key, "EXPLODEFROST"))
copy(sprite_g_frost_exp, charsmax(sprite_g_frost_exp), value)
else if (equal(key, "EXPLODEINFECT"))
copy(sprite_g_inf_exp, charsmax(sprite_g_inf_exp), value)
else if (equal(key, "GIBSFIRE"))
copy(sprite_g_fire_gibs, charsmax(sprite_g_fire_gibs), value)
else if (equal(key, "GIBSFROST"))
copy(sprite_g_frost_gibs, charsmax(sprite_g_frost_gibs), value)
else if (equal(key, "GIBSINFECT"))
copy(sprite_g_inf_gibs, charsmax(sprite_g_inf_gibs), value)
Добавляем в
zombieplague.iniEXPLODEFIRE = sprites/BuB9neC/grenade/exp_fire.spr
EXPLODEFROST = sprites/BuB9neC/grenade/exp_frost.spr
EXPLODEINFECT = sprites/BuB9neC/grenade/exp_infect.spr
GIBSFIRE = sprites/BuB9neC/grenade/gibs_fire.spr
GIBSFROST = sprites/BuB9neC/grenade/gibs_frost.spr
GIBSINFECT = sprites/BuB9neC/grenade/gibs_infect.spr
Автор:BuB9neC
скачать dle 12.0