搜索
查看: 11314|回复: 31

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

[复制链接]
发表于 2008-5-29 10:34:30 | 显示全部楼层 |阅读模式 来自 中国–广西–南宁
喜欢的请支持.......发现错误的请指导.............

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
发表于 2008-5-29 11:50:18 | 显示全部楼层 来自 中国–广东–揭阳

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

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

使用道具 举报

发表于 2008-5-29 13:44:15 | 显示全部楼层 来自 中国–广东–深圳–盐田区

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

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

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

.先顶一下先.支持

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注个册吧

×
回复

使用道具 举报

发表于 2008-5-29 15:01:10 | 显示全部楼层 来自 中国–广东–东莞

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

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

请LZ说一下。。。
回复

使用道具 举报

发表于 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_BLOODSPRITE  115
#define TE_BLOODSTREAM  101
#define TE_MODEL  106
#define TE_WORLDDECAL  116
/************************************************************
* MAIN
************************************************************/
new gHealthIndex[MAX_PLAYERS+1]
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[iVictim] = get_user_health(iVictim)

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

public event_death()
{
get_gore_flags()
new iOrigin[3]
new sWeapon[MAX_NAME_LENGTH]
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[iVictim] - 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[2] = iOrigin[2]-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[MAX_PLAYERS], iNumPlayers, iOrigin[3]
  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[id] = get_user_health(id)
fx_trans(id,255)
return PLUGIN_CONTINUE
}
public get_gore_flags()
{
new sFlags[24]
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[3])
{
  message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  write_byte(TE_BLOODSPRITE)
  write_coord(origin[0]+random_num(-20,20))
  write_coord(origin[1]+random_num(-20,20))
  write_coord(origin[2]+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[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(-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[3],num)
{
// Blood decals
static const blood_small[7] = {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[0]+random_num(-100,100))
  write_coord(origin[1]+random_num(-100,100))
  write_coord(origin[2]-36)
  write_byte(blood_small[random_num(0,6)]) // index
  message_end()
}
}
static fx_blood_large(origin[3],num)
{
// Blood decals
static const blood_large[2] = {204,205}
// Large splash
for (new i = 0; i < num; i++) {
  message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  write_byte(TE_WORLDDECAL)
  write_coord(origin[0]+random_num(-50,50))
  write_coord(origin[1]+random_num(-50,50))
  write_coord(origin[2]-36)
  write_byte(blood_large[random_num(0,1)]) // index
  message_end()
}
}
static fx_gib_explode(origin[3],num)
{
new flesh[3], x, y, z
flesh[0] = mdl_gib_flesh
flesh[1] = mdl_gib_meat
flesh[2] = mdl_gib_legbone
// Gib explosion
// Head
message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
write_byte(TE_MODEL)
write_coord(origin[0])
write_coord(origin[1])
write_coord(origin[2])
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[0])
write_coord(origin[1])
write_coord(origin[2])
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[0])
  write_coord(origin[1])
  write_coord(origin[2])
  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[0])
  write_coord(origin[1])
  write_coord(origin[2])
  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[random_num(0,2)])
  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[0]+(x*j))
   write_coord(origin[1]+(y*j))
   write_coord(origin[2]+(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[3])
{
// Blood spray, 5 times
for (new i = 0; i < 5; i++) {
  message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
  write_byte(101)
  write_coord(origin[0])
  write_coord(origin[1])
  write_coord(origin[2]+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
}
回复

使用道具 举报

发表于 2008-11-23 21:36:16 | 显示全部楼层 来自 中国–香港

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

thank you,頂一下!
回复

使用道具 举报

雨在梦中下的粉 该用户已被删除
发表于 2008-11-24 12:48:34 | 显示全部楼层 来自 中国–广东–韶关
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

发表于 2008-11-26 02:29:22 | 显示全部楼层 来自 中国–湖北–黄冈

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

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

使用道具 举报

 楼主| 发表于 2008-11-26 08:50:00 | 显示全部楼层 来自 中国–广西–百色–右江区

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

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

使用道具 举报

发表于 2009-4-4 03:54:19 | 显示全部楼层 来自 中国–广东–茂名
看起来不错。下来试试先。谢了
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表