Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <amxmisc>
- #include <fakemeta>
- #define PLUGIN "Mensajes cpo"
- #define VERSION "1.0"
- #define AUTHOR "........"
- #define TASK_TUT 1111
- enum
- {
- RED = 1,
- BLUE,
- YELLOW,
- GREEN
- }
- enum CsTeams
- {
- CS_TEAM_UNASSIGNED = 0,
- CS_TEAM_T = 1,
- CS_TEAM_CT = 2,
- CS_TEAM_SPECTATOR = 3
- };
- new const num_teams = 2;
- new g_MsgTutor,g_MsgTutClose,g_MsgTitle
- //New Cvars
- new g_CvarCName,g_CvarMsg,g_CvarMsg2,g_MsgTime,g_MsgTime2
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- // Msg
- g_MsgTutor = get_user_msgid("TutorText")
- g_MsgTitle = get_user_msgid("GameTitle")
- g_MsgTutClose = get_user_msgid("TeamNames")
- //Cvars
- g_CvarMsg = register_cvar("amx_notice_1","1 mensaje")
- g_CvarMsg2 = register_cvar("amx_notice_2","2 mensaje")
- //Comunidadde
- g_CvarCName = register_cvar("amx_n_cname","o teu website")
- //Tempo das mensajes
- g_MsgTime = register_cvar("amx_n_time_1","150.0")
- g_MsgTime2 = register_cvar("amx_n_time_2","250.0")
- //Task
- set_task(get_pcvar_float(g_MsgTime),"CmdMsg")
- set_task(get_pcvar_float(g_MsgTime2),"CmdMsg2")
- }
- public client_putinserver(id)
- {
- set_task(2.0,"CmdWelcomeMessage",id)
- }
- public CmdWelcomeMessage(id)
- {
- new Cname[200],targetname[32]
- get_user_name(id,targetname,31)
- get_pcvar_string(g_CvarCName, Cname, charsmax(Cname))
- new Text[192]
- formatex(Text,191,"%s Welcom To %s",targetname, Cname)
- MsgWelcome(id,Text,YELLOW,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) {
- new Teamn[195]
- message_begin(MSG_ALL,g_MsgTutor,_,id)
- write_string(Text)
- write_byte(0)
- write_short(0)
- write_short(0)
- write_short(1<<2)
- 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<<2)
- 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_MsgTutClose,_,id)
- message_end()
- }
- /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
- *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3082\\ f0\\ fs16 \n\\ par }
- */
Add Comment
Please, Sign In to add comment