搜索
查看: 2526|回复: 4

Osker Lee老大进来,嫁接礼物插件

[复制链接]
发表于 2008-3-14 18:42:06 | 显示全部楼层 |阅读模式 来自 中国–广东–中山
Osker Lee老大你看看这个能嫁接在一起吗,下面上原代码,把那些礼物嫁接到这个newroundgift代码上面,这个代码是在官方下载的,其他的是点通下载的代码

本帖子中包含更多资源

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

×
发表于 2008-3-15 12:21:52 | 显示全部楼层 来自 中国–甘肃–兰州

回复: Osker Lee老大进来,嫁接礼物插件

玩家获得礼物,是每局都能获得呢,还是每局随机获得?还有就是#include "dtgifts"的dtgifts.inc文件哪去了?
回复

使用道具 举报

 楼主| 发表于 2008-3-15 21:16:50 | 显示全部楼层 来自 中国–广东–中山

回复: Osker Lee老大进来,嫁接礼物插件

这个是礼物插件是玩家有权限才能捡的礼物插件,你看看能不能嫁接到这个下面


/* AMX Mod X
*   New Round Gift
*
* (c) Copyright 2005 by VEN
*
* This file is provided as is (no warranties)
*
*     DESCRIPTION:
*       Every new round at the CT and T respawn randomly appears gift.
*
*     NOTE:
*       Gift wouldn't appear for team with only one player!
*
*     FEATURES:
*       Plugin make gift collection fun and interesting because:
*         - you don't know where is gift would appear
*         - you don't know what is inside
*         - sometimes you must run fast and even jump
*
*     MODULES:
*       - engine
*       - fun
*
*     CONFIGURATION:
*       Available items can be changed (GIFT_ITEM_NUM, GIFT_ITEM), default: vest, vesthelm, nades.
*
*       Gift model can be changed (GIFT_MODEL), default: "models/w_battery.mdl".
*
*       Plugin can be disabled by changing "amx_newround_gift" CVAR value to 0.
*/
#include <amxmodx>
#include <engine>
#include <fun>
#define MAX_PLAYERS 32
#define GIFT_ITEM_NUM 5
new const GIFT_ITEM[GIFT_ITEM_NUM][] = {
"item_kevlar",
"item_assaultsuit",
"weapon_hegrenade",
"weapon_flashbang",
"weapon_smokegrenade"
}
#define GIFT_MODEL "models/w_battery.mdl"
#define GIFT_NAME "gift"
public plugin_init() {
register_plugin("New Round Gift", "0.1", "VEN")
register_logevent("logevent_round_start", 2, "0=World triggered", "1=Round_Start")
register_event("RoundTime", "event_round_time", "bc")
register_touch(GIFT_NAME, "player", "touch_gift")
register_cvar("amx_newround_gift", "1")
}
public plugin_modules() {
require_module("engine")
require_module("fun")
}
public plugin_precache() {
precache_model(GIFT_MODEL)
}
public logevent_round_start() {
if (!get_cvar_num("amx_newround_gift"))
  return
new pnum[2], origin[3], minor[2][3], maxor[2][3], bool:compare[2]
for (new i = 1; i <= MAX_PLAYERS; ++i) {
  if (!is_user_alive(i))
   continue
  new team = get_user_team(i) - 1
  if (team != 0 && team != 1)
   continue
  pnum[team]++
  get_user_origin(i, origin)
  if (compare[team]) {
   for (new j = 0; j < 3; ++j) {
    if (origin[j] < minor[team][j])
     minor[team][j] = origin[j]
    if (origin[j] > maxor[team][j])
     maxor[team][j] = origin[j]
   }
  }
  else {
   minor[team] = origin
   maxor[team] = origin
   compare[team] = true
  }
}
for (new i = 0; i < 2; ++i) {
  if (pnum < 2)
   continue
  new gift = create_entity("info_target")
  if (!gift) {
   log_amx("ERROR: Couldn't create gift entity!")
   continue
  }
  entity_set_string(gift, EV_SZ_classname, GIFT_NAME)
  entity_set_int(gift, EV_INT_solid, SOLID_TRIGGER)
  new Float:gift_origin[3]
  for (new j = 0; j < 3; ++j)
   gift_origin[j] = float(random_num(minor[j], maxor[j]))
  gift_origin[2] += 40
  entity_set_vector(gift, EV_VEC_origin, gift_origin)
  entity_set_model(gift, GIFT_MODEL)
}
}
public touch_gift(gift, id) {
give_item(id, GIFT_ITEM[random(GIFT_ITEM_NUM)])
remove_entity(gift)
}
public event_round_time() {
if (read_data(1) == get_cvar_num("mp_freezetime")) {
  new gift = 0
  while ((gift = find_ent_by_class(gift, GIFT_NAME)))
   remove_entity(gift)
}
}
回复

使用道具 举报

发表于 2008-3-16 10:53:35 | 显示全部楼层 来自 中国–四川

回复: Osker Lee老大进来,嫁接礼物插件

这个插件有点类似于DCOO的大礼包插件哦,关注中~~~
回复

使用道具 举报

发表于 2009-4-14 22:57:59 | 显示全部楼层 来自 中国–广东–茂名
这个插件有点类似于DCOO的大礼包插件哦,关注中~~~
311890 发表于 2008-3-16 10:53

不错。。很像。。可以给个官网地址来不?
回复

使用道具 举报

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

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