心静如水 发表于 2008-5-29 10:34:30

没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..

喜欢的请支持.......发现错误的请指导.............

lxhshigege1234 发表于 2008-5-29 11:50:18

回复: 没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..

谢谢了!沙发!!好东西要顶

点通粉丝 发表于 2008-5-29 13:44:15

回复: 没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..

LZ姐姐你那个声音文件..音效不错哦.其待有更好的作品出来

LZ姐姐我用你那个原码..也修改了一个..效果好象比你的好哦.你试一下比点意见

.先顶一下先.支持

yzmzx 发表于 2008-5-29 15:01:10

回复: 没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..

不知道和其他版本有什么区别?

请LZ说一下。。。

lanmao 发表于 2008-5-29 17:35:28

回复: 没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..

/*
* AMXMOD script.
* (plugin_gore.sma)
* by mike_cao <mike@mikecao.com>
* This file is provided as is (no warranties).
*
* This plugin adds gore effects. It is configured
* with the cvar "amx_gore" using these flags:
*
* a - Headshot blood
* b - Extra blood effects
* c - Bleeding on low health
* d - Gib explosion (knife, HE, high damage only)
*
*/
#include <amxmodx>
#include <fun>
#define MAX_NAME_LENGTH 32
#define MAX_VAR_LENGTH 64
#define MAX_PLAYERS 32
#define MAX_TEXT_LENGTH 512
#define GORE_HEADSHOT   (1<<0) // "a"
#define GORE_BLOOD   (1<<1) // "b"
#define GORE_BLEEDING   (1<<2) // "c"
#define GORE_GIB(1<<3) // "d"
#define TE_BLOODSPRITE115
#define TE_BLOODSTREAM101
#define TE_MODEL106
#define TE_WORLDDECAL116
/************************************************************
* MAIN
************************************************************/
new gHealthIndex
new mdl_gib_flesh
new mdl_gib_head
new mdl_gib_legbone
new mdl_gib_lung
new mdl_gib_meat
new mdl_gib_spine
new spr_blood_drop
new spr_blood_spray
new iFlags
public event_damage()
{
get_gore_flags()
new iVictim = read_data(0)
gHealthIndex = get_user_health(iVictim)

if (iFlags&GORE_BLOOD) {
new iOrigin
get_user_origin(iVictim,iOrigin)
fx_blood(iOrigin)
fx_blood_small(iOrigin,1)
}
return PLUGIN_CONTINUE
}

public event_death()
{
get_gore_flags()
new iOrigin
new sWeapon
new ikiller = read_data(1)
new iVictim = read_data(2)
new iHeadshot = read_data(3)

read_data(4,sWeapon,MAX_NAME_LENGTH)

if (iFlags&GORE_HEADSHOT && iHeadshot) {
get_user_origin(iVictim,iOrigin)
fx_headshot(iOrigin)
client_cmd(ikiller,"spk misc/head")
return PLUGIN_CONTINUE
}
else if (iFlags&GORE_GIB && (equal(sWeapon,"CS_AWP") || equal(sWeapon,"grenade") || (gHealthIndex - get_user_health(iVictim)) > 80)) {
get_user_origin(iVictim,iOrigin)
// Effects
fx_trans(iVictim,0)
fx_gib_explode(iOrigin,5)
fx_blood_large(iOrigin,3)
fx_blood_small(iOrigin,20)
// Hide body
iOrigin = iOrigin-50
set_user_origin(iVictim,iOrigin)
client_cmd(ikiller,"spk misc/head")
}
return PLUGIN_CONTINUE
}
public event_blood()
{
get_gore_flags()
if (iFlags&GORE_BLEEDING) {
new iPlayer, iPlayers, iNumPlayers, iOrigin
get_players(iPlayers,iNumPlayers,"a")
for (new i = 0; i < iNumPlayers; i++) {
   iPlayer = iPlayers
   if (get_user_health(iPlayer) < 10) {
    get_user_origin(iPlayer,iOrigin)
    fx_bleed(iOrigin)
    fx_blood_small(iOrigin,1)
   }
}
}
}
public event_respawn(id)
{
gHealthIndex = get_user_health(id)
fx_trans(id,255)
return PLUGIN_CONTINUE
}
public get_gore_flags()
{
new sFlags
get_cvar_string("amx_gore",sFlags,24)
iFlags = read_flags(sFlags)
}
/************************************************************
* FX FUNCTIONS
************************************************************/
static fx_trans(player,amount)
{
set_user_rendering(player,kRenderFxNone,0,0,0,kRenderTransAlpha,amount)
return PLUGIN_CONTINUE
}
public fx_blood(origin)
{
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BLOODSPRITE)
write_coord(origin+random_num(-20,20))
write_coord(origin+random_num(-20,20))
write_coord(origin+random_num(-20,20))
write_short(spr_blood_spray)
write_short(spr_blood_drop)
write_byte(229) // color index
write_byte(10) // size
message_end()
}
public fx_bleed(origin)
{
// Blood spray
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_BLOODSTREAM)
write_coord(origin)
write_coord(origin)
write_coord(origin+10)
write_coord(random_num(-100,100)) // x
write_coord(random_num(-100,100)) // y
write_coord(random_num(-10,10)) // z
write_byte(70) // color
write_byte(random_num(50,100)) // speed
message_end()
}
static fx_blood_small(origin,num)
{
// Blood decals
static const blood_small = {190,191,192,193,194,195,197}

// Small splash
for (new j = 0; j < num; j++) {
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
write_coord(origin+random_num(-100,100))
write_coord(origin+random_num(-100,100))
write_coord(origin-36)
write_byte(blood_small) // index
message_end()
}
}
static fx_blood_large(origin,num)
{
// Blood decals
static const blood_large = {204,205}
// Large splash
for (new i = 0; i < num; i++) {
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_WORLDDECAL)
write_coord(origin+random_num(-50,50))
write_coord(origin+random_num(-50,50))
write_coord(origin-36)
write_byte(blood_large) // index
message_end()
}
}
static fx_gib_explode(origin,num)
{
new flesh, x, y, z
flesh = mdl_gib_flesh
flesh = mdl_gib_meat
flesh = mdl_gib_legbone
// Gib explosion
// Head
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_MODEL)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(random_num(-100,100))
write_coord(random_num(-100,100))
write_coord(random_num(100,200))
write_angle(random_num(0,360))
write_short(mdl_gib_head)
write_byte(0) // bounce
write_byte(500) // life
message_end()

// Spine
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_MODEL)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(random_num(-100,100))
write_coord(random_num(-100,100))
write_coord(random_num(100,200))
write_angle(random_num(0,360))
write_short(mdl_gib_spine)
write_byte(0) // bounce
write_byte(500) // life
message_end()

// Lung
for(new i = 0; i < random_num(1,2); i++) {
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_MODEL)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(random_num(-100,100))
write_coord(random_num(-100,100))
write_coord(random_num(100,200))
write_angle(random_num(0,360))
write_short(mdl_gib_lung)
write_byte(0) // bounce
write_byte(500) // life
message_end()
}

// Parts, 5 times
for(new i = 0; i < 5; i++) {
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_MODEL)
write_coord(origin)
write_coord(origin)
write_coord(origin)
write_coord(random_num(-100,100))
write_coord(random_num(-100,100))
write_coord(random_num(100,200))
write_angle(random_num(0,360))
write_short(flesh)
write_byte(0) // bounce
write_byte(500) // life
message_end()
}

// Blood
for(new i = 0; i < num; i++) {
x = random_num(-100,100)
y = random_num(-100,100)
z = random_num(0,100)
for(new j = 0; j < 5; j++) {
   message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
   write_byte(TE_BLOODSPRITE)
   write_coord(origin+(x*j))
   write_coord(origin+(y*j))
   write_coord(origin+(z*j))
   write_short(spr_blood_spray)
   write_short(spr_blood_drop)
   write_byte(229) // color index
   write_byte(15) // size
   message_end()
}
}
}
public fx_headshot(origin)
{
// Blood spray, 5 times
for (new i = 0; i < 5; i++) {
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(101)
write_coord(origin)
write_coord(origin)
write_coord(origin+30)
write_coord(random_num(-20,20)) // x
write_coord(random_num(-20,20)) // y
write_coord(random_num(50,300)) // z
write_byte(70) // color
write_byte(random_num(100,200)) // speed
message_end()
}
}
/************************************************************
* PLUGIN FUNCTIONS
************************************************************/

public plugin_precache()
{
spr_blood_drop = precache_model("sprites/blood.spr")
spr_blood_spray = precache_model("sprites/bloodspray.spr")
mdl_gib_flesh = precache_model("models/Fleshgibs.mdl")
mdl_gib_head = precache_model("models/GIB_Skull.mdl")
mdl_gib_legbone = precache_model("models/GIB_Legbone.mdl")
mdl_gib_lung = precache_model("models/GIB_Lung.mdl")
mdl_gib_meat = precache_model("models/GIB_B_Gib.mdl")
mdl_gib_spine = precache_model("models/GIB_B_Bone.mdl")
precache_sound("misc/head.wav")
}
public plugin_init()
{
register_plugin("Plugin Gore","1.1","mike_cao")
register_event("DeathMsg","event_death","a")
register_event("Damage","event_damage","b","2!0","3=0","4!0")
register_event("ResetHUD","event_respawn","be","1=1")
register_cvar("amx_gore","abcd")
set_task(1.0,"event_blood",0,"",0,"b")
return PLUGIN_CONTINUE
}

Desmond 发表于 2008-11-23 21:36:16

回复: 没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..

thank you,頂一下!

雨在梦中下的粉 发表于 2008-11-24 12:48:34

pj001234 发表于 2008-11-26 02:29:22

回复: 没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..

问一下楼主~在什么情况下呢声音才会响呀?
我装上后没听到有呢声音!

心静如水 发表于 2008-11-26 08:50:00

回复: 没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..

Post by pj001234
问一下楼主~在什么情况下呢声音才会响呀?
我装上后没听到有呢声音!
应该是暴头吧...................................

jiajiazf 发表于 2009-4-4 03:54:19

看起来不错。下来试试先。谢了
页: [1] 2 3 4
查看完整版本: 没事发个很稳定的血腥插件和修改的原码,俺服稳定运行2个月了..