|
发表于 2010-1-13 11:45:00
|
显示全部楼层
来自 中国–广东–深圳
- #include <amxmodx>
- #include <fakemeta>
- #define PLUGIN "Convert ping to frags"
- #define VERSION "0.1"
- #define AUTHOR "epic"
- new High_ping
- new Extra_frags
- // CS Teams
- enum
- {
- CS_TEAM_UNASSIGNED = 0,
- CS_TEAM_T,
- CS_TEAM_CT,
- CS_TEAM_SPECTATOR
- }
- public plugin_init()
- {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_event("DeathMsg", "DeathEvent", "a")
- High_ping = register_cvar( "Convertpingtofrags_Highping", "10" )
- Extra_frags = register_cvar( "Convertpingtofrags_Extrafrags", "2" )
- }
- public DeathEvent()
- {
- new victimId = read_data(2)
- new killerId = read_data(1)
- if (!killerId || killerId==victimId)
- return PLUGIN_CONTINUE
- if (get_user_team(killerId)==get_user_team(victimId))
- return PLUGIN_CONTINUE
- CheckPing(killerId)
- return PLUGIN_CONTINUE
- }
- public CheckPing(id)
- {
-
- new ping, loss
-
- get_user_ping(id, ping, loss)
-
- if (ping >= High_ping)
-
- {
-
- set_pev(id, pev_frags, float(pev(id, pev_frags) + Extra_frags))
- // client_print ( id, print_chat,"frags:%d",pev(id, pev_frags))
- // update scoreboard
- message_begin(MSG_BROADCAST,get_user_msgid("ScoreInfo"));
- write_byte(id);
- write_short(pev(id, pev_frags));
- write_short(fm_get_user_deaths(id));
- write_short(0);
- write_short(fm_get_user_team(id));
- message_end();
-
- }
-
- }
- // Get User Deaths
- stock fm_get_user_deaths(id)
- {
- return get_pdata_int(id, 444, 5);
- }
- // Get User Team
- stock fm_get_user_team(id)
- {
- return get_pdata_int(id, 114, 5);
- }
复制代码 试试这个吧
应该行的 |
|