hlmod.hu
https://hlmod.hu/

Ezt h lehetne HUD üzenetté tenni?
https://hlmod.hu/viewtopic.php?f=9&t=3139
Oldal: 1 / 1

Szerző:  CeDee [2012.01.17. 21:50 ]
Hozzászólás témája:  Ezt h lehetne HUD üzenetté tenni?

Ezt h lehetne HUD üzenette tenni, hogy kör elejen ezt írná ki..
Keszulj fel a harcra xy kor!

CeDee

Itt az sma
Kód:
#include <amxmodx>
#include <amxmisc>

#define VERSION "1.3"


new rounds_elapsed;
new play_sound;
new chat_message;
new g_maxplayers;
new g_map[32]
new say_text;

public plugin_init()
{
   /* Register plugin and author */
   register_plugin("Vox Round Say", VERSION, "God@Dorin")
   
   
   /* Register plugin version by cvar */
   register_cvar("round_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
   set_cvar_string("round_version", VERSION);

   /* Register new round events */
   register_event("HLTV", "new_round", "a", "1=0", "2=0");
   register_event("TextMsg", "restart_round", "a", "2=#Game_will_restart_in");

   /* Register language file */
   register_dictionary("round_message.txt");

   /* Register plugin cvars */
   play_sound = register_cvar("amx_playsound","1");
   chat_message = register_cvar("amx_chatmessage","1");
   g_maxplayers = get_maxplayers();
   get_mapname(g_map, 31)
   
   say_text = get_user_msgid("sayText");
}
public new_round()
{
   rounds_elapsed += 1;
   
   new p_playernum;
   p_playernum = get_playersnum(1);
   
   if(get_pcvar_num(chat_message) == 1)
   {   
      client_printc(0, "%L", 0, "RND_MSG", rounds_elapsed, g_map, p_playernum, g_maxplayers);
   }
   if(get_pcvar_num(play_sound) == 1)
   {
      new rndctstr[21]
      num_to_word(rounds_elapsed, rndctstr, 20);
      client_cmd(0, "spk ^"vox/round %s^"",rndctstr)
   }   
   return PLUGIN_CONTINUE;
}
public restart_round()
{
   rounds_elapsed = 0;   
}
stock client_printc(const id, const string[], {Float, Sql, Resul,_}:...) {
   
   new msg[191], players[32], count = 1;
   vformat(msg, sizeof msg - 1, string, 3);
   
   replace_all(msg,190,"!g","^4");
   replace_all(msg,190,"!y","^1");
   replace_all(msg,190,"!t","^3");
   
   if(id)
      players[0] = id;
   else
      get_players(players,count,"ch");
   
   new index;
   for (new i = 0 ; i < count ; i++)
   {
      index = players[i];
      message_begin(MSG_ONE_UNRELIABLE, say_text,_, index);
      write_byte(index);
      write_string(msg);
      message_end(); 
   } 
   
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1048\\ f0\\ fs16 \n\\ par }
*/


És itt a LANG

Kód:
[en]
RND_MSG = !y[Farkasok] Keszulj fel a harcra %d kor!

Szerző:  kiki [2012.01.18. 07:05 ]
Hozzászólás témája:  Re: Ezt h lehetne HUD üzenetté tenni?

Megcsinalom delutan, addig egy kerdes
Kód:
client_printc(0, "%L", 0, "RND_MSG", rounds_elapsed, g_map, p_playernum, g_maxplayers);


Minek van lekerve benne jelenlegi map, az online jatekosok, es a slotszam ha nem is hasznalod?

Szerző:  CeDee [2012.01.18. 14:17 ]
Hozzászólás témája:  Re: Ezt h lehetne HUD üzenetté tenni?

Mert egy pluginbol szedtem ki amiben irja a mapot a körök számát...csak nemtudtam kivenni...
megtudnatok csinálni vagy mondani??

Szerző:  kiki [2012.01.18. 14:24 ]
Hozzászólás témája:  Re: Ezt h lehetne HUD üzenetté tenni?

Ittvan, de van ilyen alap funckiója a csstatsnak azt hiszem, ui: a langot nemkell változtatni mielőtt megkérdeznéd:)

Kód:
#include <amxmodx>
#include <amxmisc>

#define VERSION "1.3"


new rounds_elapsed;
new play_sound;
new chat_message;
new g_map[32]
new say_text;

public plugin_init()
{
   /* Register plugin and author */
   register_plugin("Vox Round Say", VERSION, "God@Dorin")
   
   
   /* Register plugin version by cvar */
   register_cvar("round_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
   set_cvar_string("round_version", VERSION);

   /* Register new round events */
   register_event("HLTV", "new_round", "a", "1=0", "2=0");
   register_event("TextMsg", "restart_round", "a", "2=#Game_will_restart_in");

   /* Register language file */
   register_dictionary("round_message.txt");

   /* Register plugin cvars */
   play_sound = register_cvar("amx_playsound","1");
   chat_message = register_cvar("amx_chatmessage","1");
   get_mapname(g_map, 31)
   
   say_text = get_user_msgid("sayText");
}
public new_round()
{
   rounds_elapsed += 1;
   
   if(get_pcvar_num(chat_message) == 1)
   {   
      set_hudmessage(26, 237, 19, 0.29, 0.17, 0, 6.0, 5.0)
      show_hudmessage(0, "%L", 0, "RND_MSG", rounds_elapsed)
   }
   if(get_pcvar_num(play_sound) == 1)
   {
      new rndctstr[21]
      num_to_word(rounds_elapsed, rndctstr, 20);
      client_cmd(0, "spk ^"vox/round %s^"",rndctstr)
   }   
   return PLUGIN_CONTINUE;
}
public restart_round()
{
   rounds_elapsed = 0;   
}
stock client_printc(const id, const string[], {Float, Sql, Resul,_}:...) {
   
   new msg[191], players[32], count = 1;
   vformat(msg, sizeof msg - 1, string, 3);
   
   replace_all(msg,190,"!g","^4");
   replace_all(msg,190,"!y","^1");
   replace_all(msg,190,"!t","^3");
   
   if(id)
      players[0] = id;
   else
      get_players(players,count,"ch");
   
   new index;
   for (new i = 0 ; i < count ; i++)
   {
      index = players[i];
      message_begin(MSG_ONE_UNRELIABLE, say_text,_, index);
      write_byte(index);
      write_string(msg);
      message_end(); 
   } 
}

Szerző:  CeDee [2012.01.18. 15:11 ]
Hozzászólás témája:  Re: Ezt h lehetne HUD üzenetté tenni?

Hát nem müködik...
Ez HUD-ba tenné ki?

Szerző:  kiki [2012.01.18. 15:57 ]
Hozzászólás témája:  Re: Ezt h lehetne HUD üzenetté tenni?

Kód:
#include <amxmodx>
#include <amxmisc>

#define VERSION "1.3"


new rounds_elapsed;
new play_sound;
new chat_message;
new g_map[32]
new say_text;

public plugin_init()
{
   /* Register plugin and author */
   register_plugin("Vox Round Say", VERSION, "God@Dorin")
   
   
   /* Register plugin version by cvar */
   register_cvar("round_version", VERSION, FCVAR_SERVER | FCVAR_SPONLY);
   set_cvar_string("round_version", VERSION);

   /* Register new round events */
   register_event("HLTV", "new_round", "a", "1=0", "2=0");
   register_event("TextMsg", "restart_round", "a", "2=#Game_will_restart_in");

   /* Register language file */
   register_dictionary("round_message.txt");

   /* Register plugin cvars */
   play_sound = register_cvar("amx_playsound","1");
   chat_message = register_cvar("amx_chatmessage","1");
   get_mapname(g_map, 31)
   
   say_text = get_user_msgid("sayText");
}
public new_round()
{
   rounds_elapsed += 1;
   
   if(get_pcvar_num(chat_message) == 1)
   {   
      set_hudmessage(26, 237, 19, 0.29, 0.17, 0, 6.0, 5.0)
      show_hudmessage(0, "%L", LANG_SERVER, "RND_MSG", rounds_elapsed)
   }
   if(get_pcvar_num(play_sound) == 1)
   {
      new rndctstr[21]
      num_to_word(rounds_elapsed, rndctstr, 20);
      client_cmd(0, "spk ^"vox/round %s^"",rndctstr)
   }   
   return PLUGIN_CONTINUE;
}
public restart_round()
{
   rounds_elapsed = 0;   
}


Jónak kell lennie, még nézd meg így talán

Oldal: 1 / 1 Minden időpont UTC+02:00 időzóna szerinti
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/