Hello i have this plugin:
PHP Code:
#include <amxmodx>
#define PLUGIN "Welcome Messages and Rules with CZ-Style Tutor Messages"
#define VERSION "0.3"
#define TUTORIAL 1001
#define TASK_TUT 1111
enum
{
RED = 1,
BLUE,
YELLOW,
GREEN
}
new const g_TutorPrecache[][] =
{
"gfx/career/icon_!.tga",
"gfx/career/icon_!-bigger.tga",
"gfx/career/icon_i.tga",
"gfx/career/icon_i-bigger.tga",
"gfx/career/icon_skulls.tga",
"gfx/career/round_corner_ne.tga",
"gfx/career/round_corner_nw.tga",
"gfx/career/round_corner_se.tga",
"gfx/career/round_corner_sw.tga",
"resource/TutorScheme.res",
"resource/UI/TutorTextWindow.res"
}
new g_MsgTutor;
new g_MsgTutClose;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, "R14170")
register_clcmd("say /rules", "showRules");
register_clcmd("say_team /rules", "showRules");
g_MsgTutor = get_user_msgid("TutorText")
g_MsgTutClose = get_user_msgid("TutorClose")
}
public plugin_precache()
{
new i;
for(i = 0; i < sizeof g_TutorPrecache; i++)
{
precache_generic(g_TutorPrecache[i])
}
}
public client_connect(id)
{
set_task(3.0, "welcomeMessage", id)
}
public welcomeMessage(id)
{
new Text[100];
new name[42];
get_user_name(id, name, 32)
formatex(Text, 191, "Welcome, %s!^nHave fun playing here!^nType /rules to see the rules.", name)
MakeTutor(id, Text, GREEN, 10.0)
}
public showRules(id)
{
new Text[100];
formatex(Text, 191, "Rules:^n^n1. Rule1^n2. Rule2^n3. Rule3^n4. Rule4^n5. Rule5^n^nFollow these rules, please!")
MakeTutor(id, Text, YELLOW, 15.0)
}
MakeTutor(id, Text[], Color, Float:Time = 0.0)
{
if(is_user_connected(id))
{
message_begin(MSG_ONE_UNRELIABLE, g_MsgTutor, _, id)
write_string(Text)
write_byte(0)
write_short(0)
write_short(0)
write_short(1<<Color)
message_end()
}
if(Time != 0.0) {
if( task_exists(id + TASK_TUT ))
{
remove_task(id + TASK_TUT)
}
set_task(Time,"RemoveTutor",id + TASK_TUT)
}
}
public RemoveTutor(taskID)
{
new id = taskID - TASK_TUT
message_begin(MSG_ALL,g_MsgTutClose,_,id)
message_end()
}
and I would like the messages to appear where I show you in the next picture:
__________________