Gdy wpisuje w consoli amx_tutor <kolor/ ja wezme green> <tutaj moj tekst>
to się pojawi tutor
o kolorze zielonym z wiadomością tutaj moj tekst
OTO SMA by Harsay :
#include <amxmodx> #include <amxmisc> #define PLUGIN "Tutor Info" #define VERSION "1.0" #define AUTHOR "Harsay" #define TUTORIAL 1001 #define TASK_TUT 1111 #define MSOUND "items/nvg_off.wav" /* dźwięk który będzie odtwarzany gdy tutor się ukarze */ enum { RED = 1, BLUE, YELLOW, GREEN } /* 4 typy o których wspominałem */ 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" } /* Pliki które są potrzebne aby tutor wyglądał jak w czero */ new g_MsgTutor new g_MsgTutClose public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) g_MsgTutor = get_user_msgid("TutorText") g_MsgTutClose = get_user_msgid("TutorClose") } public plugin_precache() /* tego chyba nie muszę tłumaczyć */ { precache_sound(MSOUND) new i for(i = 0; i < sizeof g_TutorPrecache; i++) { precache_generic(g_TutorPrecache[i]) } } /* Tutaj znajdują się ustawienia aby tutor działał */ 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<<Color) message_end() } else { 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 if(!id){ message_begin(MSG_ALL,g_MsgTutClose,_,id) message_end() } else { message_begin(MSG_ONE_UNRELIABLE,g_MsgTutClose,_,id) message_end() } }