|
发表于 2009-10-29 21:53:41
|
显示全部楼层
|阅读模式
来自 中国–广东–广州
本帖最后由 kk阿朗 于 2010-3-25 20:52 编辑
这个插件经过我测试过,20个人都可以- #include <amxmodx>
- #include <cstrike>
- #include <hamsandwich>
- #define NAME "show teammate's money"
- #define VERSION "1.1"
- #define AUTHOR "K.K.Lv"
- new g_max_players;
- public plugin_init()
- {
- register_plugin(NAME, VERSION, AUTHOR);
-
- RegisterHam(Ham_Spawn, "player", "player_spawn", 1);
- g_max_players = get_maxplayers();
- }
- public player_spawn(client)
- {
- if (is_user_connected(client))
- {
- set_task(1.0, "show_money", client);
- }
- }
- public show_money(client)
- {
- new message[1024];
- new money;
- new name[32];
- new len = format(message, sizeof message - 1, "The teammate's money:^n");
- for (new id = 1; id <= g_max_players; id++)
- {
- if (!is_user_connected(id)) continue;
- if (id != client)
- {
- if (cs_get_user_team(id) == cs_get_user_team(client))
- {
- money = cs_get_user_money(id);
- get_user_name(id, name, 31);
- len += format(message[len], sizeof message - 1 -len, "%-22.22s: %d^n", name, money);
- }
- }
- }
- set_hudmessage(100, 200, 0, 0.05, 0.35, 0, 0.02, 5.0, 0.1, 0.2, 2);
- show_hudmessage(client, message);
- }
复制代码 |
|