View Single Post
nooberlin
Junior Member
Join Date: Jun 2015
Old 06-18-2015 , 14:04   Re: Round Message w/ VOX v1.3
Reply With Quote #52

Quote:
Originally Posted by ANTICHRISTUS View Post
Make sure what's changing it, check your related files .ini or .cfg files.
Thanx! Ready!

Another question: where i need set maxrounds cvar? In server.cfg or in plugin .sma file?

I found this parameter: num_to_word(rounds_elapsed, rndctstr, 30);

30 rounds, and in server.cfg 30 rounds... But I have bug - I have warmup plugin too, and plugin say 1 round and start warmup round, then restart and one more time say 1 round... But when 30 round is finish, then say 31 round and make restart... Why?

Can anybody help me to change the code, i need that plugin rounds will stop when start warmup round, and after restart thisround start working. But when 30 round is finished, than just restart the map and do not say and show 31/30 round.. And when working warmup plugin, i need all weapons restricted, because, when someone buy weapons and die, then another player can get this weapon and use it...

rounds plugin code:

PHP Code:
#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"VERSIONFCVAR_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_map31)
    
    
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_elapsedg_mapp_playernumg_maxplayers); 
    }
    if(
get_pcvar_num(play_sound) == 1)
    {
        new 
rndctstr[21]
        
num_to_word(rounds_elapsedrndctstr30);
        
client_cmd(0"spk ^"vox/round %s^"",rndctstr)
    }    
    return 
PLUGIN_CONTINUE;
}
public 
restart_round()
{
    
rounds_elapsed 0;    
}
stock client_printc(const id, const string[], {FloatSqlResul,_}:...) {
    
    new 
msg[191], players[32], count 1;
    
vformat(msgsizeof msg 1string3);
    
    
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 
count i++)
    {
        
index players[i];
        
message_begin(MSG_ONE_UNRELIABLEsay_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 }
*/ 
warmup plugin code:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <dhudmessage>
#include <hamsandwich>
#include <fun>
 
new TimerSecondsCvar
new bool:g_knife true
 
public plugin_init()
{
    
register_plugin"Auto rr" "1.0""ill" )
    
    
register_event("DeathMsg""on_death""a")
    
register_event"CurWeapon""EventCurWeapon""be""2!29" )
    
   
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn_Post"1)
    
    
SecondsCvar register_cvar("auto_rr_time","60")
 
    
Timer get_pcvar_num(SecondsCvar)
    
set_task(1.0"start_rr_timer"___"a"Timer)
}
 
public 
plugin_precache()
{
   
precache_sound("misc/warmup.mp3")
}
 
public 
fw_PlayerSpawn_Post(id)
{
   if(!
is_user_alive(id))
        return
       
   if(
g_knife)
      
set_user_health(id35)
}
 
public 
on_death()
{
   new 
victim
   victim 
read_data(2)
    
   if(
g_knife)
      
set_task(1.0"fnRevivePlayer"victim)
}
 
public 
client_putinserver(id)
{
   if(
g_knife)
      
set_task(3.0"Start_sound"id)
}
 
public 
Start_sound(id)
{
   if(
g_knife)
   {
      
client_cmd(id"mp3 play sound/misc/warmup.mp3")
      if(!
is_user_alive(id) && (get_user_team(id) == || get_user_team(id) == 2) ) 
         
ExecuteHamB(Ham_CS_RoundRespawnid)
   }
}
 
public 
fnRevivePlayer(id
{
   if(!
is_user_alive(id)) 
      
ExecuteHamB(Ham_CS_RoundRespawnid)
}
 
public 
EventCurWeapon(id)
{
   if(
g_knife
      
engclient_cmd(id"weapon_knife")
}
 
public 
start_rr_timer()
{
    
Timer--
     
    
set_dhudmessage(135206235, -1.00.0800.00.01)
    
show_dhudmessage(0"WarmUp!^nRestart after %d seconds"Timer)
 
    if(
Timer 1)
    {
      
server_cmd("sv_restartround 1")
      
set_task(3.0"rr_end")
      
client_cmd(0"mp3 stop");
      
g_knife false
    
}
}
 
public 
rr_end()
{
    
set_dhudmessagerandom_num(0255), random_num(0255), random_num(0255), -1.00.7826.03.00.11.5false )
    
show_dhudmessage(0"LIVE! LIVE! LIVE!")


Last edited by nooberlin; 06-18-2015 at 14:07. Reason: notifications
nooberlin is offline