#include #include #define PLUGIN "Tutor Text" #define VERSION "1.0" #define AUTHOR "Zepa" #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, AUTHOR) register_concmd("amx_tutor", "cmdTsaykon", ADMIN_CHAT, " ") register_clcmd("say", "cmdTsaygra", ADMIN_CHAT, "# - komenda amx_tutor") 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]) } } MakeTutor(id,Text[],Color,Float:Time = 0.0) { if(is_user_connected( id )) { if(!id){ message_begin(MSG_ALL,g_MsgTutor) write_string(Text) write_byte(0) write_short(0) write_short(0) write_short(1< 3) { return PLUGIN_CONTINUE } new message[192], a = 0 read_args(message, 191) remove_quotes(message) parse(message, color, 15) new length = (strlen(color) + 1) new n, s = i if (a) { n++ s++ } while (said[s] && isspace(said[s])) { n++ s++ } new name[32] get_user_name(id, name, 31) formatex(Text,191,"%s", message[length]); for(new i=1; i<=33; i++){ { if (is_user_connected(i)) { if(said[i] == 'g') MakeTutor(i,Text,GREEN,10.0) else if(said[i] == 'r') MakeTutor(i,Text,RED,10.0) else if(said[i] == 'y') MakeTutor(i,Text,YELLOW,10.0) else MakeTutor(i,Text,BLUE,10.0) } } } return PLUGIN_HANDLED }