广告广告
  加入我的最爱 设为首页 风格修改
首页 首尾
 手机版   订阅   地图  繁体 
您是第 3237 个阅读者
 
发表文章 发表投票 回覆文章
  可列印版   加为IE收藏   收藏主题   上一主题 | 下一主题   
playboi 手机
数位造型
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x2 鲜花 x7
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片
推文 x0
[1.6][插件] 这个SMA是哪里有问题??
抱歉不会贴图~~

所以就只好这样放了~~

问题:

自从改了fm_get_user_bpammo(id, CSW_P228, 130)................

就是获得的子弹数量~~

就便这样了~~


谢谢搂~

-------------

#include <amxmodx>
#include <fakemeta>
#include <zombieplague>
#include <zp_presents2>
#define PLUGIN_NAME "ZP 补给箱"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "xp200798"
#define fm_create_entity(%1) engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, %1))
#define OFFSET_AWM_AMMO   377
#define OFFSET_SCOUT_AMMO  378
#define OFFSET_PARA_AMMO  379
#define OFFSET_FAMAS_AMMO  380
#define OFFSET_M3_AMMO   381
#define OFFSET_USP_AMMO   382
#define OFFSET_FIVESEVEN_AMMO  383
#define OFFSET_DEAGLE_AMMO  384
#define OFFSET_P228_AMMO  385
#define OFFSET_GLOCK_AMMO  386
#define OFFSET_FLASH_AMMO  387
#define OFFSET_HE_AMMO   388
#define OFFSET_SMOKE_AMMO  389
#define OFFSET_C4_AMMO   390
// Weapon bitsums
const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|
 (1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|
 (1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
public plugin_init()
{
 register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
}
public zp_present_get(id,const name[])
{
 new num = random_num(1, 16) //最小为1 最大为20 随机取得 可自行增加与减少
 switch (num)
 {
  case 1:
  {
   drop_weapons(id, 2)
   fm_give_item(id, "weapon_p228")
   fm_give_item(id, "ammo_357sig")
                        fm_get_user_bpammo(id, CSW_P228, 130)
   
   client_print(0, print_center, "%s 捡到一把 P228 <次要武器>", name)
  }
  case 2:
  {
   drop_weapons(id, 2)
   fm_give_item(id, "weapon_fiveseven")
   fm_give_item(id, "ammo_57mm")
                        fm_get_user_bpammo(id, CSW_FIVESEVEN, 200)
   
   client_print(0, print_center, "%s 捡到一把 FIVESEVEN <次要武器>", name)
  }
  case 3:
  {
   drop_weapons(id, 2)
   fm_give_item(id, "weapon_deagle")
   fm_give_item(id, "ammo_50ae")
                        fm_get_user_bpammo(id, CSW_DEAGLE, 70)
   
   client_print(0, print_center, "%s 捡到一把 DEAGLE <次要武器>", name)
  }
  case 4:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_mp5navy")
   fm_give_item(id, "ammo_9mm")
                        fm_get_user_bpammo(id, CSW_MP5NAVY, 150)
   
   client_print(0, print_center, "%s 捡到一把 MP5 <主要武器>", name)
  }
  case 5:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_tmp")
   fm_give_item(id, "ammo_9mm")
                        fm_get_user_bpammo(id, CSW_TMP, 150)
   
   client_print(0, print_center, "%s 捡到一把 TMP <主要武器>", name)
  }
  case 6:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_mac10")
   fm_give_item(id, "ammo_45acp")
                        fm_get_user_bpammo(id, CSW_MAC10, 150)
   
   client_print(0, print_center, "%s 捡到一把 MAC10 <主要武器>", name)
  }
  case 7:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_ump45")
   fm_give_item(id, "ammo_45acp")
                        fm_get_user_bpammo(id, CSW_UMP45, 125)
   
   client_print(0, print_center, "%s 捡到一把 UMP45 <主要武器>", name)
  }
  case 8:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_p90")
   fm_give_item(id, "ammo_57mm")
                        fm_get_user_bpammo(id, CSW_P90, 150)
   
   client_print(0, print_center, "%s 捡到一把 P90 <主要武器>", name)
  }
  case 9:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_galil")
   fm_give_item(id, "ammo_556nato")
                        fm_get_user_bpammo(id, CSW_GALIL, 175)
   
   client_print(0, print_center, "%s 捡到一把 GALIL <主要武器>", name)
  }
  case 10:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_famas")
   fm_give_item(id, "ammo_556nato")
                        fm_get_user_bpammo(id, CSW_FAMAS, 125)
   
   client_print(0, print_center, "%s 捡到一把 FAMAS <主要武器>", name)
  }
  case 11:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_ak47")
   fm_give_item(id, "ammo_762nato")
                        fm_get_user_bpammo(id, CSW_AK47, 150)
   
   client_print(0, print_center, "%s 捡到一把 AK47 <主要武器>", name)
  }
  case 12:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_m4a1")
   fm_give_item(id, "ammo_556nato")
                        fm_get_user_bpammo(id, CSW_M4A1, 150)
   
   client_print(0, print_center, "%s 捡到一把 M4A1 <主要武器>", name)
  }
  case 13:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_sg552")
   fm_give_item(id, "ammo_556nato")
                        fm_get_user_bpammo(id, CSW_SG552, 150)
   
   client_print(0, print_center, "%s 捡到一把 SG552 <主要武器>", name)
  }
  case 14:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_aug")
   fm_give_item(id, "ammo_556nato")
                        fm_get_user_bpammo(id, CSW_AUG, 150)
   
   client_print(0, print_center, "%s 捡到一把 AUG <主要武器>", name)
  }
  case 15:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_scout")
   fm_give_item(id, "ammo_762nato")
                        fm_get_user_bpammo(id, CSW_SCOUT, 100)
   
   client_print(0, print_center, "%s 捡到一把 SCOUT <主要武器>", name)
  }
  case 16:
  {
   drop_weapons(id, 1)
   fm_give_item(id, "weapon_awp")
   fm_give_item(id, "ammo_338magnum")
                        fm_get_user_bpammo(id, CSW_AWP, 50)
   
   client_print(0, print_center, "%s 捡到一把 AWP <主要武器>", name)
  }
  default: //预设
  {
   client_print(0, print_center, "%s 捡到一个空箱", name)
  }
 }
}
stock fm_give_item(index, const item[]) {
 if (!equal(item, "weapon_", 7) && !equal(item, "ammo_", 5) && !equal(item, "item_", 5) && !equal(item, "tf_weapon_", 10))
  return 0;
 new ent = fm_create_entity(item);
 if (!pev_valid(ent))
  return 0;
 new Float:origin[3];
 pev(index, pev_origin, origin);
 set_pev(ent, pev_origin, origin);
 set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
 dllfunc(DLLFunc_Spawn, ent);
 new save = pev(ent, pev_solid);
 dllfunc(DLLFunc_Touch, ent, index);
 if (pev(ent, pev_solid) != save)
  return ent;
 engfunc(EngFunc_RemoveEntity, ent);
 return -1;
}
stock fm_set_user_bpammo(index, weapon, amount)
{
 new offset;
 
 switch(weapon)
 {
  case CSW_AWP: offset = OFFSET_AWM_AMMO;
  case CSW_SCOUT,CSW_AK47,CSW_G3SG1: offset = OFFSET_SCOUT_AMMO;
  case CSW_M249: offset = OFFSET_PARA_AMMO;
  case CSW_M4A1,CSW_FAMAS,CSW_AUG,CSW_SG550,CSW_GALIL,CSW_SG552: offset = OFFSET_FAMAS_AMMO;
  case CSW_M3,CSW_XM1014: offset = OFFSET_M3_AMMO;
  case CSW_USP,CSW_UMP45,CSW_MAC10: offset = OFFSET_USP_AMMO;
  case CSW_FIVESEVEN,CSW_P90: offset = OFFSET_FIVESEVEN_AMMO;
  case CSW_DEAGLE: offset = OFFSET_DEAGLE_AMMO;
  case CSW_P228: offset = OFFSET_P228_AMMO;
  case CSW_GLOCK18,CSW_MP5NAVY,CSW_TMP,CSW_ELITE: offset = OFFSET_GLOCK_AMMO;
  case CSW_FLASHBANG: offset = OFFSET_FLASH_AMMO;
  case CSW_HEGRENADE: offset = OFFSET_HE_AMMO;
  case CSW_SMOKEGRENADE: offset = OFFSET_SMOKE_AMMO;
  case CSW_C4: offset = OFFSET_C4_AMMO;
  default:
  {
   new invalidMsg[20 + 7];
   formatex(invalidMsg,20 + 6,"Invalid weapon id %d",weapon);
   set_fail_state(invalidMsg);
   
   return 0;
  }
 }
 
 set_pdata_int(index,offset,amount);
 
 return 1;
}
stock fm_get_user_bpammo(index, weapon)
{
 new offset;
 
 switch(weapon)
 {
  case CSW_AWP: offset = OFFSET_AWM_AMMO;
  case CSW_SCOUT,CSW_AK47,CSW_G3SG1: offset = OFFSET_SCOUT_AMMO;
  case CSW_M249: offset = OFFSET_PARA_AMMO;
  case CSW_M4A1,CSW_FAMAS,CSW_AUG,CSW_SG550,CSW_GALIL,CSW_SG552: offset = OFFSET_FAMAS_AMMO;
  case CSW_M3,CSW_XM1014: offset = OFFSET_M3_AMMO;
  case CSW_USP,CSW_UMP45,CSW_MAC10: offset = OFFSET_USP_AMMO;
  case CSW_FIVESEVEN,CSW_P90: offset = OFFSET_FIVESEVEN_AMMO;
  case CSW_DEAGLE: offset = OFFSET_DEAGLE_AMMO;
  case CSW_P228: offset = OFFSET_P228_AMMO;
  case CSW_GLOCK18,CSW_MP5NAVY,CSW_TMP,CSW_ELITE: offset = OFFSET_GLOCK_AMMO;
  case CSW_FLASHBANG: offset = OFFSET_FLASH_AMMO;
  case CSW_HEGRENADE: offset = OFFSET_HE_AMMO;
  case CSW_SMOKEGRENADE: offset = OFFSET_SMOKE_AMMO;
  case CSW_C4: offset = OFFSET_C4_AMMO;
  default:
  {
   new invalidMsg[20 + 7];
   formatex(invalidMsg,20 + 6,"Invalid weapon id %d",weapon);
   set_fail_state(invalidMsg);
   
   return 0;
  }
 }
 
 return get_pdata_int(index,offset);
 
}
stock drop_weapons(id, dropwhat) // dropwhat: 1 = primary weapon , 2 = secondary weapon
{
 // Get user weapons
 static weapons[32], num, i, weaponid
 num = 0 // reset passed weapons count (bugfix)
 get_user_weapons(id, weapons, num)
 
 // Loop through them and drop primaries or secondaries
 for (i = 0; i < num; i++)
 {
  // Prevent re-indexing the array
  weaponid = weapons
  
  if ((dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM)) || (dropwhat == 2 && ((1<<weaponid) & SECONDARY_WEAPONS_BIT_SUM)))
  {
   // Get weapon name
   static wname[32]
   get_weaponname(weaponid, wname, charsmax(wname))
   
   // Drop weapon
   engclient_cmd(id, "drop", wname)
  }
 }
}


[ 此文章被shxs101tw在2011-01-22 00:14重新编辑 ]

此文章被评分,最近评分记录
财富:0 (by 恶魔之枪) | 理由: 你的图片到底在哪?



献花 x0 回到顶端 [楼 主] From:台湾中华电信 | Posted:2010-03-15 18:41 |
a7811311622 手机
个人头像
个人文章 个人相簿 个人日记 个人地图
特殊贡献奖 优秀管理员勋章 社区建设奖
头衔:我…在工作了…我…在工作了…
版主
级别: 版主 该用户目前不上站
版区: CS提问区
推文 x771 鲜花 x2152
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

请放SMA吧…就算知道错在哪…没档案我也不会说明… 表情


尚无签名,欢迎 [新增个性化签名]
献花 x0 回到顶端 [1 楼] From:台湾教育部 | Posted:2010-03-15 20:10 |
zdt
个人文章 个人相簿 个人日记 个人地图
初露锋芒
级别: 初露锋芒 该用户目前不上站
推文 x51 鲜花 x40
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

竟然说有图........
正题:你自己转一下就知道啦


献花 x0 回到顶端 [2 楼] From:未知地址 | Posted:2011-01-29 22:19 |
林亮
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x0 鲜花 x2
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

== 没放档 我怎嚜看

此文章被评分,最近评分记录
财富:-20 (by a7811311622) | 理由: 无意义回覆!


献花 x0 回到顶端 [3 楼] From:台湾中华电信 | Posted:2011-02-04 01:27 |
林亮
个人文章 个人相簿 个人日记 个人地图
小人物
级别: 小人物 该用户目前不上站
推文 x0 鲜花 x2
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

回 覆 锁 定 :

  此回覆已被锁定,只有『管理员及回覆者』看的到 !!!



此文章被评分,最近评分记录
财富:-50 (by a7811311622) | 理由: 恶意灌水!(锁回文)


献花 x0 回到顶端 [4 楼] From:台湾中华电信 | Posted:2011-02-04 02:05 |
zdt
个人文章 个人相簿 个人日记 个人地图
初露锋芒
级别: 初露锋芒 该用户目前不上站
推文 x51 鲜花 x40
分享: 转寄此文章 Facebook Plurk Twitter 复制连结到剪贴簿 转换为繁体 转换为简体 载入图片

你怎么就这么不踏实呢!你用回你的fm_give_iteam(id, "ammo_XXX"不久可以了嘛!多写几次就会有这么多弹夹啦


献花 x0 回到顶端 [5 楼] From:未知地址 | Posted:2011-02-04 10:39 |

首页  发表文章 发表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.022744 second(s),query:16 Gzip disabled
本站由 瀛睿律师事务所 担任常年法律顾问 | 免责声明 | 本网站已依台湾网站内容分级规定处理 | 连络我们 | 访客留言