|
每回合开始给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[33][33]//存放玩家名字的二位数组
- new bool:g_restart_attempt[MAX_PLAYERS + 1]//跟重新开局有关的变量
- 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[32], num
- get_players(players, num, "a")
- for (new i; i < num; ++i)
- g_restart_attempt[players[i]] = true
- }
- public event_hud_reset(id)
- {
- if (g_restart_attempt[id])
- {
- g_restart_attempt[id] = false
- return PLUGIN_CONTINUE
- }
- event_player_spawn(id)
- return PLUGIN_HANDLED
- }
- public event_player_spawn(id)
- {
- //获取玩家的名字
- get_user_name(id,UserName[id],32)
- if (is_user_bot(id))
- {
- cs_set_user_money (id,16000,1)
- }
- return PLUGIN_HANDLED
- }
复制代码 |
|