Jednak kiedy samodzielnie ustawiam parametry wysokości i szerokości to wiadomość pojawia mi się obok radaru w lewym górnym rogu ekranu. Proszę o pomoc i z góry dziękuje. Poniżej podaje kod SMA:
#include <amxmod>
#include <amxmisc>
#define MAX_MESSAGES 10new g_Messages[MAX_MESSAGES][384]
new g_MessagesNum
new g_Current
new g_teamScore[2]
public plugin_init()
{
register_plugin("Info. Messages 2.1", "1.2", "AMXX Dev Team | 2.0 by graczu")
register_srvcmd("amx_hud_msg", "setMessage")
register_cvar("amx_hud_msgtime", "80")
register_event("TeamScore", "team_score", "a")new lastinfo[8]
get_localinfo("lastinfomsg", lastinfo, 7)
g_Current = str_to_num(lastinfo)
set_localinfo("lastinfomsg", "")
}
public infoMessage()
{
if (g_Current >= g_MessagesNum)
g_Current = 0new hostname[64]
new nextmap[32]
new timeleft = get_timeleft()
new timeformat[32]
new maxrounds = get_cvar_num("mp_maxrounds")
new roundsleft[32]
get_cvar_string("hostname", hostname, 63)
get_cvar_string("amx_nextmap", nextmap, 31)
if (timeleft > 0)
{
new timeleftVar[6]
get_cvar_string("amx_timeleft", timeleftVar, 6)
format(timeformat, 31, "%s", timeleftVar)
} else {
format(timeformat, 31, "No Limit")
}if(maxrounds > 0)
{
format(roundsleft, 31, "%i", maxrounds - (g_teamScore[0] + g_teamScore[1]))
} else {
format(roundsleft, 31, "No Round Limit")
}
new afterReplaceMSG[384]
formatex(afterReplaceMSG, 380, "%s", g_Messages[g_Current])replace(afterReplaceMSG, 380, "%hostname%", hostname)
replace(afterReplaceMSG, 380, "%nextmap%", nextmap)
replace(afterReplaceMSG, 380, "%timeleft%", timeformat)
replace(afterReplaceMSG, 380, "%roundsleft%", roundsleft)
new color1=random_num(0,255)
new color2=random_num(0,255)
new color3=random_num(0,255)set_hudmessage(color1, color2, color3, 0.05, 0.65, 1, 1.0, 10.0, 0.01, 0.1, 3)
show_hudmessage(0, "%s", afterReplaceMSG)
client_print(0, print_console, "%s", afterReplaceMSG)
++g_Current
new Float:freq_im = get_cvar_float("amx_hud_msgtime")
if (freq_im > 0.0)
set_task(freq_im, "infoMessage", 12345)
}
public setMessage()
{
if (g_MessagesNum >= MAX_MESSAGES)
{
return PLUGIN_HANDLED
}remove_task(12345)
read_argv(1, g_Messages[g_MessagesNum], 380)
while (replace(g_Messages[g_MessagesNum], 380, "\n", "^n")) {}
g_MessagesNum++
new Float:freq_im = get_cvar_float("amx_hud_msgtime")
if (freq_im > 0.0)
set_task(freq_im, "infoMessage", 12345)
return PLUGIN_HANDLED
}
public team_score()
{
new team[2]
read_data(1, team, 1)
g_teamScore[(team[0]=='C') ? 0 : 1] = read_data(2)
}public plugin_end()
{
new lastinfo[8]
num_to_str(g_Current, lastinfo, 7)
set_localinfo("lastinfomsg", lastinfo)
}