Bot永远不缺钱插件
每回合开始给BOT加满16000,很简单的一个插件。/* UTF-8 func by www.DT-Club.net */#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define MAX_PLAYERS 32
#define PLUGIN_NAME "Bot Money"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "masher0782"
new UserName//存放玩家名字的二位数组
new bool:g_restart_attempt//跟重新开局有关的变量
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR);
//玩家重生事件
register_event("ResetHUD", "event_hud_reset", "be")
register_clcmd("fullupdate", "clcmd_fullupdate")
register_event("TextMsg", "event_restart_attempt", "a", "2=#Game_will_restart_in")
return PLUGIN_CONTINUE
}
//当玩家重新开局的时候
public clcmd_fullupdate()
{
return PLUGIN_HANDLED
}
public event_restart_attempt()
{
new players, num
get_players(players, num, "a")
for (new i; i < num; ++i)
g_restart_attempt] = true
}
public event_hud_reset(id)
{
if (g_restart_attempt)
{
g_restart_attempt = false
return PLUGIN_CONTINUE
}
event_player_spawn(id)
return PLUGIN_HANDLED
}
publicevent_player_spawn(id)
{
//获取玩家的名字
get_user_name(id,UserName,32)
if (is_user_bot(id))
{
cs_set_user_money (id,16000,1)
}
return PLUGIN_HANDLED
} 光是$16000的话..
代码过于复杂了:lol 那请问什么地方多余了呢?
我是直接用hc_spy改的..:lol 我个人觉得楼主这个插件应该可以用很简便的代码写出来!
个人建议LZ再详细看看代码,好像有些都可以不要的!! 照LZ这样说的效果,只要注意每局开都把BOT的金钱设为16000就行了!! 本帖最后由 kk阿朗 于 2009-8-15 12:45 编辑
楼主看这样可以吗?
我没测试!不过我是照您的意思写的!#include <amxmodx>
#include <cstrike>
#define PLUGIN_NAME "Bot Money"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "masher0782"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_logevent("NewRound", 2, "0=World triggered", "1=Round_Start")
}
public NewRound()
{
new player, pnum
get_players(player, pnum)
for (new i = 0; i < pnum; i++)
{
new id = player
if (is_user_bot(id))
{
cs_set_user_money(id, 16000, 1)
}
}
} 本帖最后由 sakulekingz 于 2009-8-15 00:00 编辑
这样最简单#include <amxmodx>
#include <cstrike>
#define PLUGIN_NAME "Bot Money"
#define PLUGIN_VERSION "1.0"
#define PLUGIN_AUTHOR "masher0782"
public plugin_init()
{
register_plugin(PLUGIN_NAME, PLUGIN_VERSION, PLUGIN_AUTHOR)
register_event("ResetHUD", "event_hud_reset", "be")
}
public event_hud_reset(id)
{
if (is_user_bot(id))
{
cs_set_user_money (id,16000,1)
}
return PLUGIN_HANDLED
}
学习了,其实我不怎么会编的,比如事件我都不会编,都是直接照着别的插件改的。:'(
kk阿朗 的编译成功了,但是貌似没效果:L
sakulekingz 的可以用。:lol
话说我有种想叫你乌龟兄的冲动:lol 有点疏忽,现在应该没问题了!! 支持!!!!!!!!!!!!!!!
页:
[1]
2