查看别的FPS和ping
本帖最后由 opopp 于 2012-2-4 19:16 编辑amx_fps_show (0/1)
amx_fps_bots (0/1)
amx_fps_sfc (0/1)
#include <amxmodx>
#include <engine>
new g_fps;
new g_i;
new g_maxplayers;
public plugin_init() {
register_plugin("fps", "fps", "fps")
register_srvcmd("players","show_info")
g_maxplayers = get_maxplayers()
}
public show_info()
{
new name
new ping,loss
server_print("NAME | FPS | Ping | Loss")
for(new i=1;i<=g_maxplayers;i++)
{
if(!is_user_connected(i) || is_user_bot(i))
continue;
get_user_ping(i,ping,loss)
get_user_name(i,name,31)
server_print("%s | %ifps | %iping | %iloss",name,get_user_fps(i),ping,loss)
}
}
//code from get_fps tutorial
public client_putinserver(id)
set_task(0.1, "count", id, "", 0, "b");
public client_disconnect(id)
remove_task(id);
public client_PreThink(id)
g_fps++;
public count(id) {
if ( g_i < 9 )
g_i++;
else
g_i = 0;
g_fps] = g_fps;
g_fps = 0;
}
get_user_fps(id)
{
new i;
new j = 0;
for ( i = 0; i < 9; i++ )
j += g_fps;
return j - 5;
感谢LZ无私奉献;P 这个插件有意思。。 不明白具体是怎么使用的
页:
[1]