Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #define PLUGIN "Tutor by +Frag'Lider"
- #define VERSION "1.0"
- #define AUTHOR "fsck"
- #define TASK_TUT 1111
- enum
- {
- RED = 1,
- BLUE,
- YELLOW,
- GREEN
- }
- new g_MsgTutor
- new g_MsgTutorClose
- new g_CvarCName
- new g_CvarMsg
- new g_CvarMsg2
- new g_MsgTime
- new g_MsgTime2
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- g_MsgTutor = get_user_msgid("TutorText")
- g_MsgTutorClose = get_user_msgid("TutorClose")
- g_CvarMsg = register_cvar("amx_notice_1","Exprimenta a nossa Radio faz /radio!")
- g_CvarMsg2 = register_cvar("amx_notice_2","Diverte-te conosco!")
- g_CvarCName = register_cvar("amx_n_cname","XJUMPERS")
- g_MsgTime = register_cvar("amx_n_time_1","50.0")
- g_MsgTime2 = register_cvar("amx_n_time_2","100.0")
- set_task(get_pcvar_float(g_MsgTime),"CmdMsg")
- set_task(get_pcvar_float(g_MsgTime2),"CmdMsg2")
- }
- public client_putinserver(id)
- {
- set_task(10.0,"CmdWelcomeMessage",id)
- }
- public CmdWelcomeMessage(id)
- {
- new Cname[200]
- get_pcvar_string(g_CvarCName, Cname, charsmax(Cname))
- new player_name[32]
- get_user_name(id,player_name,31)
- new szAuthID[ 33 ]
- get_user_authid(id,szAuthID,32)
- new Text[192]
- formatex(Text,191,"Juntou-se %s (%s)^nBem-Vindo à Comunidade %s",player_name,szAuthID,Cname)
- MsgWelcome(id,Text,GREEN,10.0)
- }
- public CmdMsg(id)
- {
- new message[200]
- get_pcvar_string(g_CvarMsg, message, charsmax(message))
- new Text1[192]
- formatex(Text1,191,"%s", message)
- MakeTutor(id,Text1,YELLOW,15.0)
- }
- public CmdMsg2(id)
- {
- new message[200]
- get_pcvar_string(g_CvarMsg2, message, charsmax(message))
- new Text2[192]
- formatex(Text2,191,"%s", message)
- MakeTutor(id,Text2,YELLOW,15.0)
- }
- MakeTutor(id,Text[],Color,Float:Time = 0.0) {
- message_begin(MSG_ALL,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) {
- set_task(Time,"RemoveTutor",id + TASK_TUT)
- }
- }
- MsgWelcome(id,Text[],Color,Float:Time = 0.0) {
- 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) {
- set_task(Time,"RemoveTutor",id + TASK_TUT)
- }
- }
- public RemoveTutor(taskID) {
- new id = taskID - TASK_TUT
- message_begin(MSG_ALL,g_MsgTutorClose,_,id)
- message_end()
- }
Add Comment
Please, Sign In to add comment