Пользователь
- Сообщения
- 32
- Реакции
- 3
- Предупреждения
- 100
Обратите внимание, если вы хотите заключить сделку с этим пользователем, он заблокирован
Всем добра и счастья. У меня возник вопрос , как переместить HUD на сервере ниже ... перепробывал все варианты ...не помогает ...
Подскажите пожалуйта
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "FPS"
#define VERSION "1.0"
#define AUTHOR "Sho0ter"
new Float:gametime
new Float:framesper
new show[33]
new show2[33]
new clientfps[33]
new hud
new fps
new maxplayers
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /serverfps", "cmd_show")
register_clcmd("say /clientfps", "cmd_show2")
register_forward(FM_StartFrame, "start_frame")
register_forward(FM_PlayerPreThink, "client_think")
hud = CreateHudSyncObj()
maxplayers = get_maxplayers()
return PLUGIN_CONTINUE
}
public cmd_show(id)
{
if(!show[id])
{
show[id] = 1
}
else
{
show[id] = 0
}
return PLUGIN_HANDLED
}
public cmd_show2(id)
{
if(!show2[id])
{
show2[id] = 1
}
else
{
show2[id] = 0
}
return PLUGIN_HANDLED
}
public client_disconnect(id)
{
show[id] = 0
show2[id] = 0
return PLUGIN_CONTINUE
}
public client_think(id)
{
if(show2[id]) clientfps[id]++
}
public start_frame()
{
gametime = get_gametime()
if(framesper >= gametime)
{
fps++
}
else
{
framesper += 1.0
for(new id = 1; id <= maxplayers; id++)
{
if(!is_user_connected(id) || (!show[id] && !show2[id]))
{
continue
}
new msg[128], len
if(show2[id])
{
len = format(msg, charsmax(msg), "Ваше FPS: %d", clientfps[id])
}
if(show[id])
{
len += format(msg[len], charsmax(msg) - len, "%sFPS сервера: %d", show2[id] ? "^n" : "", fps)
}
ShowSyncHudMsg(id, hud, msg)
clientfps[id] = 1
}
fps = 1
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/
Подскажите пожалуйта
#include <amxmodx>
#include <fakemeta>
#define PLUGIN "FPS"
#define VERSION "1.0"
#define AUTHOR "Sho0ter"
new Float:gametime
new Float:framesper
new show[33]
new show2[33]
new clientfps[33]
new hud
new fps
new maxplayers
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /serverfps", "cmd_show")
register_clcmd("say /clientfps", "cmd_show2")
register_forward(FM_StartFrame, "start_frame")
register_forward(FM_PlayerPreThink, "client_think")
hud = CreateHudSyncObj()
maxplayers = get_maxplayers()
return PLUGIN_CONTINUE
}
public cmd_show(id)
{
if(!show[id])
{
show[id] = 1
}
else
{
show[id] = 0
}
return PLUGIN_HANDLED
}
public cmd_show2(id)
{
if(!show2[id])
{
show2[id] = 1
}
else
{
show2[id] = 0
}
return PLUGIN_HANDLED
}
public client_disconnect(id)
{
show[id] = 0
show2[id] = 0
return PLUGIN_CONTINUE
}
public client_think(id)
{
if(show2[id]) clientfps[id]++
}
public start_frame()
{
gametime = get_gametime()
if(framesper >= gametime)
{
fps++
}
else
{
framesper += 1.0
for(new id = 1; id <= maxplayers; id++)
{
if(!is_user_connected(id) || (!show[id] && !show2[id]))
{
continue
}
set_hudmessage(0, 255, 0, 0.05, -1.0, 0, 1.0, 1.1, 0.1, 0.1, -1)
if(show2[id])
{
len = format(msg, charsmax(msg), "Ваше FPS: %d", clientfps[id])
}
if(show[id])
{
len += format(msg[len], charsmax(msg) - len, "%sFPS сервера: %d", show2[id] ? "^n" : "", fps)
}
ShowSyncHudMsg(id, hud, msg)
clientfps[id] = 1
}
fps = 1
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1034\\ f0\\ fs16 \n\\ par }
*/