搜索
楼主: mao0797

[求助]埋包拆包自动奖励插件

[复制链接]
发表于 2006-5-12 17:57:33 | 显示全部楼层 来自 华中科技大学韵苑公寓

回复: [求助]埋包拆包自动奖励插件

set_user_health ( index, health )
cs_set_user_money ( index , money, [ flash = 1] )
这两个是函数的原型,二楼已经列出具体用法.
set_user_health()如果在该事件使用,没有意义.每局开始都重新设置hp为100的.
cs_set_user_money()需要cstrike头文件.
  在此基础上,修改方法已经非常明白. 自己去了解一下怎么编写amxx插件,别老是说"谁帮我把全部源码写好".否则这里就不应该脚本编写讨论区了.
回复

使用道具 举报

发表于 2006-5-12 18:41:42 | 显示全部楼层 来自 新疆巴音郭楞州库尔勒

回复: [求助]埋包拆包自动奖励插件

Post by kinsprite
set_user_health ( index, health )
cs_set_user_money ( index , money, [ flash = 1] )
这两个是函数的原型,二楼已经列出具体用法.
set_user_health()如果在该事件使用,没有意义.每局开始都重新设置hp为100的.
cs_set_user_money()需要cstrike头文件.
在此基础上,修改方法已经非常明白. 自己去了解一下怎么编写amxx插件,别老是说"谁帮我把全部源码写好".否则这里就不应该脚本编写讨论区了.

老师一看就是个高人,学生我正在学习修改插件,很多地方还不很明白。
“cs_set_user_money()需要cstrike头文件. ”我还是搞不懂,,麻烦老师讲解一下好吗?

把二楼这个添加上了
cs_set_user_money
Cstrike (cstrike.inc)
Description
cs_set_user_money - Sets a user's money count.
Syntax
cs_set_user_money ( index , money, [ flash = 1] )
Type
Native
Notes
index is a player index from 1 to 32.

If flash is set to 0, the difference between the old and new money will NOT flash
可是编译的时候提示错误

麻烦老师了
回复

使用道具 举报

发表于 2006-5-12 19:07:43 | 显示全部楼层 来自 华中科技大学韵苑公寓

回复: [求助]埋包拆包自动奖励插件

Post by 小轩
老师一看就是个高人,学生我正在学习修改插件,很多地方还不很明白。“cs_set_user_money()需要cstrike头文件. ”我还是搞不懂,,麻烦老师讲解一下好吗? 把二楼这个添加上了cs_set_user_moneyCstrike (cstrike.inc) Descriptioncs_set_user_money - Sets a user's money count. Syntaxcs_set_user_money ( index , money, [ flash = 1] ) TypeNative Notesindex is a player index from 1 to 3...


首先,本人不是什么老师级别,也是认知这个东西不久.

你是怎么添加的?cs_set_user_money ( index , money, [ flash = 1] ) 最后一个参数flash默认为1;如果设置为0--即cs_set_user_money ( index , money, 0 ),就不出现钱变化的过程. 我给一个例子.
  1. #include <amxmodx>
  2. #include <cstrike>
  3. #include <csx>           [color="Magenta"]//需要添加这个,否则下面表明事件的函数无效.[/color]
  4. #define PLUGIN "NoBombScore"
  5. #define VERSION "1.0"
  6. #define AUTHOR "Author"
  7. public plugin_init()
  8. {
  9.         register_plugin(PLUGIN, VERSION, AUTHOR)       
  10. }
  11. public bomb_explode(planter, defuser)    // Funktion :: Bomb exploded
  12. {
  13.         set_user_frags(planter, get_user_frags(planter) - 3)       //...成功者得分减3 (CS 1.6默认已经加3)。
  14.         cs_set_user_money( planter, cs_get_user_money(planter) + 3000 )   //送额外3000$
  15.         return PLUGIN_CONTINUE;
  16. }
  17. public bomb_defused(defuser)        // Funktion :: Bomb defused
  18. {
  19.         set_user_frags ( defuser, get_user_frags(defuser) - 3 )
  20.         cs_set_user_money( defuser, cs_get_user_money(defuser) + 3000 )
  21.         return PLUGIN_CONTINUE
  22. }
复制代码
回复

使用道具 举报

发表于 2006-5-12 19:45:16 | 显示全部楼层 来自 新疆巴音郭楞州库尔勒

回复: [求助]埋包拆包自动奖励插件

万分感谢,我觉得比我懂得多的人称呼老师也不过分的。
我搞了一下,还是编译时出错
// Don't Count three Fragz on Bomb explosion / defusal
// Coded by MistaGee, requested in the "german" forum by the_venom
#include <amxmodx>
#include <amxmisc>
#include <csx>
public plugin_init(){
register_plugin("NoBombScore", "1.0", "MistaGee | 奔の驰")
}
public bomb_explode(planter, defuser){
  cs_set_user_money
  Cstrike (cstrike.inc)
  Description
  cs_set_user_money( defuser, cs_get_user_money(defuser) + 3000 )
  Syntax
  cs_set_user_money ( index , money, [ flash = 1] )
  Type
  Native
  Notes
  index is a player index from 1 to 32.
return PLUGIN_CONTINUE;
}// Funktion :: Bomb exploded
public bomb_defused(defuser){
  cs_set_user_money
  Cstrike (cstrike.inc)
  Description
  cs_set_user_money( defuser, cs_get_user_money(defuser) + 3000 )
  Syntax
  cs_set_user_money ( index , money, [ flash = 1] )
  Type
  Native
  Notes
  index is a player index from 1 to 32.
return PLUGIN_CONTINUE;
} // Funktion :: Bomb defused
回复

使用道具 举报

发表于 2006-5-12 22:39:39 | 显示全部楼层 来自 华中科技大学韵苑公寓

回复: [求助]埋包拆包自动奖励插件

Post by 小轩
万分感谢,我觉得比我懂得多的人称呼老师也不过分的。我搞了一下,还是编译时出错// Don't Count three Fragz on Bomb explosion / defusal// Coded by MistaGee, requested in the "german" forum by the_venom#include <amxmodx>#include <amxmisc>#include <csx>public plugin_init(){ register_plugin("NoBombScore", &...


你乱用了.别人告诉你那是函数原型的说明,告诉你怎么用的,不是代码部分. bomb_defused(defuser)这个函数我已经帮你写完整了,就是一个例子.  [color="Red"]上面我添加一个头文件,原因上面也写了.

多看看一些源代码吧,否则你是写不行的. 同时,你应该看一些编程C\C++等高级语言方面的书.
回复

使用道具 举报

发表于 2006-5-12 23:13:00 | 显示全部楼层 来自 新疆巴音郭楞州库尔勒

回复: [求助]埋包拆包自动奖励插件

哎,我都惆怅死了,折腾了几个小时了也没一点戏。
源码发到这里老师可不可以帮忙改一下,我这也是实在没有办法了。在linux下建了一个服务器就差这个插件了,已经找了很多天了。google了很久也没找到类似的信息。
十分感激,十分感谢。

本帖子中包含更多资源

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

×
回复

使用道具 举报

发表于 2006-5-13 10:51:22 | 显示全部楼层 来自 华中科技大学韵苑公寓

回复: [求助]埋包拆包自动奖励插件

Post by 小轩
哎,我都惆怅死了,折腾了几个小时了也没一点戏。
源码发到这里老师可不可以帮忙改一下,我这也是实在没有办法了。在linux下建了一个服务器就差这个插件了,已经找了很多天了。google了很久也没找到类似的信息。
十分感激,十分感谢。


重新看看13楼,我修改了,应该是你想要的东西.
回复

使用道具 举报

发表于 2006-5-13 16:41:47 | 显示全部楼层 来自 新疆巴音郭楞州库尔勒

回复: [求助]埋包拆包自动奖励插件

谢谢了,已经成功地装上了
现在发现有些时候还是要奖励放包成功者3人的
刚才测试了一段时间,又正常了
最早的这个插件就是装上后总是无效的。
回复

使用道具 举报

发表于 2006-5-14 10:47:36 | 显示全部楼层 来自 新疆乌鲁木齐

回复: [求助]埋包拆包自动奖励插件

Post by kinsprite
set_user_health ( index, health )
cs_set_user_money ( index , money, [ flash = 1] )
这两个是函数的原型,二楼已经列出具体用法.
set_user_health()如果在该事件使用,没有意义.每局开始都重新设置hp为100的.
cs_set_user_money()需要cstrike头文件.
在此基础上,修改方法已经非常明白. 自己去了解一下怎么编写amxx插件,别老是说"谁帮我把全部源码写好".否则这里就不应该脚本编写讨论区了.

下次不敢再这样说了,还是多学习多请教!谢谢楼主和老师了,让我也学到了一些插件知识!
回复

使用道具 举报

发表于 2010-11-1 13:51:06 | 显示全部楼层 来自 天津
谢谢了,已经成功地装上了
现在发现有些时候还是要奖励放包成功者3人的
刚才测试了一段时间,又正常了
回复

使用道具 举报

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

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