Kód:
#include <amxmodx>
#define PLUGIN "eredmenyjelzo"
#define VERSION "1.0"
#define AUTHOR "valaki"
#define SCOREBOARD_FILE "resource/UI/ScoreBoard.res"
#define MAX_SIZE 1012
new g_Text[MAX_SIZE]
new Scoreboard[34]
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
set_task(0.1,"Read_Scoreboard")
}
public Read_Scoreboard()
{
new i_File, s_File[128], Len, i
get_configsdir(s_File,charsmax(s_File))
format(s_File,charsmax(s_File),"%s/scoreboard.txt",s_File)
i_File = fopen(s_File,"r")
fgets(i_File,g_Text,MAX_SIZE)
fclose(i_File)
md5_file(s_File,Scoreboard)
Len = strlen(Scoreboard)
for(i = 4; i < Len-1; i++) Scoreboard[i] = 0
}
public client_putinserver(id)
{
new params[1]
params[0] = id
if(is_user_bot(id)) return PLUGIN_HANDLED
set_task(3.0,"Change_Scoreboard",0,params[0],1)
return PLUGIN_HANDLED
}
stock get_configsdir(s_Name[],i_Len)
{
return get_localinfo("amxx_configsdir",s_Name,i_Len)
}
public Change_Scoreboard(params[1])
{
new id = params[0]
new usersb[32]
get_user_info(id,"_sb",usersb,31)
if(!equal(usersb,Scoreboard))
{
client_cmd(id,"motdfile %s",SCOREBOARD_FILE)
client_cmd(id,"motd_write %s",g_Text)
client_cmd(id,"motdfile motd.txt")
client_cmd(id,"setinfo _sb %s",Scoreboard)
}
}
public plugin_precache()
{
precache_generic("gfx/vgui/yourbanner.tga")
}
TXT
Kód:
"Resource/UI/ScoreBoard.res"
{
"ClientScoreBoard"
{
"ControlName" "CClientScoreBoardDialog"
"fieldName" "ClientScoreBoard"
"xpos" "63"
"ypos" "42"
"wide" "444"
"tall" "480"
"autoResize" "0"
"pinCorner" "0"
"visible" "0"
"enabled" "1"
"tabPosition" "0"
}
"ServerName"
{
"ControlName" "Label"
"fieldName" "ServerName"
"xpos" "3"
"ypos" "28"
"wide" "250"
"tall" "24"
"autoResize" "0"
"visible" "1"
"enabled" "1"
"labelText" ""
"textAlignment" "north-west"
"dulltext" "0"
"brighttext""1"
}
"PlayerList"
{
"ControlName" "SectionedListPanel"
"fieldName" "PlayerList"
"xpos" "0"
"ypos" "24"
"wide" "444"
"tall" "460"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"tabPosition" "0"
"autoresize" "3"
"linespacing" "13"
}
"logo"
{
"ControlName" "ImagePanel"
"fieldName" "LogoImage"
"xpos" "107"
"ypos" "3"
"wide" "230"
"tall" "25"
"autoResize" "0"
"pinCorner" "0"
"visible" "1"
"enabled" "1"
"textAlignment" "west"
"image" "gfx/vgui/yourbanner"
"scaleImage" "1"
"zpos" "1"
}
}
Le is tölti de nem rakja be .. mi a hiba ?