Raised This Month: $32 Target: $400
 8% 

Ultimate Sounds (More Addons for Misc. Stats) 2/18/10


Post New Thread Reply   
 
Thread Tools Display Modes
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-07-2013 , 18:17   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #301

Quote:
Originally Posted by LightGamin View Post
I love this script and I want to modificate it. I want to change the streak counter, because now it counts the kills from last die - Kills in row. I only want to count the kills from the beginning of the round, which means every player loses its streak after the end of the current round and then it is starting to count again. Compare these examples.

Authentic code:
"Player" kills 3 enemies and the round ends. (He is on Triple kill)
"Player" kills an enemy and he hears Ultra kill, because he killed 4 enemies in streak without dying.

Modificated one:
"Player" kills two enemies and hears Double kill.
On the next round, "Player" kills an enemy and hears First blood, instead of Triple kill. because its streak was restarted, when the new round came.

I think this example is clear, so you can modify the script. If something is still unclear I will try to be more comprehensive. Thanks in advance!

Add this to the roundend_msg function:
Code:
kills[id] = 0

so it will look like this:

Code:
public roundend_msg(id) {     alone_ann = 0     kills[id] = 0 }
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
LightGamin
Member
Join Date: Apr 2011
Old 03-08-2013 , 10:37   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #302

I noticed that the brackets, you are using in the example, are missing.

The code was:

public rounded_msg(id)

alone_ann = 0

Should I add brackets manually ?
LightGamin is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-08-2013 , 12:26   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #303

Yes.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
LightGamin
Member
Join Date: Apr 2011
Old 03-25-2013 , 11:39   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #304

Bad news @DarkGod. Last night I hosted the server, with modified plugin as you did it or tried to do. The plugin didn't work. I have not heard any sound, during whole the game ( about 2 hours ). It is possible that I am missing something, because I changed the sound files through the sma file, and its current compiled code is

Code:
// Plugin Info
new const PLUGIN[]  = ""
new const VERSION[] = ""
new const AUTHOR[]  = ""

// Includes
#include <amxmodx>

//Defines
#define KNIFEMESSAGES 5
#define MESSAGESNOHP 5
#define MESSAGESHP 5
#define LEVELS 10

//Pcvars
new streak_mode, knife_mode, hs_mode, lastman_mode

new gmsgHudSync

new kills[33] = {0,...};
new deaths[33] = {0,...};
new alone_ann = 0
new levels[10] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11};

//Streak Sounds
new stksounds[10][] = 
{
	"misc/Fb",
	"misc/Double",
	"misc/Triple",
	"misc/Quadra",
	"misc/Penta",
	"misc/Dominating",
	"misc/Unstoppable",
	"misc/Rampage",
	"misc/Godlike",
	"misc/Humiliation"
}

new stkmessages[10][] = 
{
	"%s: First blood",
	"%s: Double kill",
	"%s: Triple kill..",
	"%s: QUADRA",
	"%s: PENTAAA",
	"%s: Dominating",
	"%s: Unstoppable",
	"%s: Rampage",
	"%s: Godlike",
	"%s: Humiliation"
}

new knifemessages[KNIFEMESSAGES][] = 
{
	"KNIFE_MSG_1",  
	"KNIFE_MSG_2",  
	"KNIFE_MSG_3",  
	"KNIFE_MSG_4",  
	"KNIFE_MSG_5"
}

new messagesnohp[MESSAGESNOHP][] = 
{
	"NOHP_MSG_1",  
	"NOHP_MSG_2",  
	"NOHP_MSG_3",  
	"NOHP_MSG_4",  
	"NOHP_MSG_5"
}

new messageshp[MESSAGESHP][] = 
{
	"HP_MSG_1",  
	"HP_MSG_2",  
	"HP_MSG_3",  
	"HP_MSG_4",  
	"HP_MSG_5"
}

public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_cvar("ultimate_sounds",VERSION,FCVAR_SERVER|FCVAR_EXTDLL|FCVAR_UNLOGGED|FCVAR_SPONLY)
	register_dictionary("ultimate_sounds.txt")
	register_event("DeathMsg","hs","a","3=1")
	register_event("DeathMsg","knife_kill","a","4&kni")
	register_event("ResetHUD", "reset_hud", "b");
	register_event("DeathMsg", "death_event", "a", "1>0");
	register_event("DeathMsg","death_msg","a")
	register_event("SendAudio","roundend_msg","a","2=%!MRAD_terwin","2=%!MRAD_ctwin","2=%!MRAD_rounddraw")
	register_event("TextMsg","roundend_msg","a","2&#Game_C","2&#Game_w")

	lastman_mode = register_cvar("lastman_mode","")
	streak_mode = register_cvar("streak_mode","ab")
	knife_mode = register_cvar("knife_mode","ab")
	hs_mode = register_cvar("hs_mode","ab")

	gmsgHudSync = CreateHudSyncObj()

	return PLUGIN_CONTINUE
}

get_streak()
{
	new streak[3]
	get_pcvar_string(streak_mode,streak,2)
	return read_flags(streak)
}

public death_event(id)
{
	new streak = get_streak()

	if ((streak&1) || (streak&2))
	{
   		new killer = read_data(1);
   		new victim = read_data(2);
		
		if (0 < killer <= get_maxplayers())
			return PLUGIN_CONTINUE;
		
   		kills[killer] += 1;
   		kills[victim] = 0;
   		deaths[killer] = 0;
   		deaths[victim] += 1;

		for (new i = 0; i < LEVELS; i++)
		{
       		if (kills[killer] == levels[i])
			{
				announce(killer, i);
				return PLUGIN_CONTINUE;
			}
		}
	}
	return PLUGIN_CONTINUE;
}

announce(killer, level)
{
	new streak = get_streak()

	if (streak&1)
	{
    		new name[32];

   		get_user_name(killer, name, 32);
		set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2);
		ShowSyncHudMsg(0, gmsgHudSync, stkmessages[level], name);
	}

	if (streak&2){
		for(new i=1;i<=get_maxplayers();i++) 
			if(is_user_connected(i)==1 )
				client_cmd(i, "spk %s", stksounds[level]); 
	}
}

public reset_hud(id)
{
	new streak = get_streak()

	if (streak&1)
	{

		if (kills[id] > levels[0])

		{
		        client_print(id, print_chat,"%L", id, "KILL_STREAK", kills[id]);
		}

		else if (deaths[id] > 1)

		{
			client_print(id, print_chat,"%L", id, "DEATH_STREAK", deaths[id]);
		}
	}
}

public client_connect(id)
{
	new streak = get_streak()

	if ((streak&1) || (streak&2))
	{
		kills[id] = 0;
		deaths[id] = 0;
	}
}

public knife_kill()
{
	new knifemode[4] 
	get_pcvar_string(knife_mode,knifemode,4) 
	new knifemode_bit = read_flags(knifemode)

	if (knifemode_bit & 1)
	{
		new killer_id = read_data(1)
		new victim_id = read_data(2)
		new killer_name[33], victim_name[33]

		get_user_name(killer_id,killer_name,33)
		get_user_name(victim_id,victim_name,33)


		set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)
		ShowSyncHudMsg(0, gmsgHudSync, "%L", LANG_PLAYER, knifemessages[ random_num(0,KNIFEMESSAGES-1) ],killer_name,victim_name)
	}

	if (knifemode_bit & 2)
	{
		for(new i=1;i<=get_maxplayers();i++) 
			if( is_user_connected(i) == 1 )
				client_cmd(i,"spk misc/aced")
   	}
}


public roundend_msg(id)
{
	alone_ann = 0
	kills[id] = 0
}

public death_msg(id)
{

	new lmmode[8] 
	get_pcvar_string(lastman_mode,lmmode,8) 
	new lmmode_bit = read_flags(lmmode)

	new players_ct[32], players_t[32], ict, ite, last
	get_players(players_ct,ict,"ae","CT")   
	get_players(players_t,ite,"ae","TERRORIST")   

	if (ict==1&&ite==1)
	{
		new name1[32], name2[32]
		get_user_name(players_ct[0],name1,32)
		get_user_name(players_t[0],name2,32)
		set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)

		if (lmmode_bit & 1)
		{
			if (lmmode_bit & 2)
			{
				ShowSyncHudMsg(0, gmsgHudSync, "%s (%i hp) vs. %s (%i hp)",name1,get_user_health(players_ct[0]),name2,get_user_health(players_t[0]))
			}

			else
			{
				ShowSyncHudMsg(0, gmsgHudSync, "%s vs. %s",name1,name2)
			}

			if (lmmode_bit & 4)
			{
				for(new i=1;i<=get_maxplayers();i++) 
					if( is_user_connected(i) == 1 )
						client_cmd(i,"")
			}
		}
	} 
	else
{   
	if (ict==1&&ite>1&&alone_ann==0&&(lmmode_bit & 4))
	{
		last=players_ct[0]
		client_cmd(last,"")

	}

	else if (ite==1&&ict>1&&alone_ann==0&&(lmmode_bit & 4))
	{
		last=players_t[0]
		client_cmd(last,"")
	}

	else
	{
		return PLUGIN_CONTINUE
	}
	alone_ann = last
	new name[32]   
	get_user_name(last,name,32)

	if (lmmode_bit & 1)
	{
		set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, 1)

		if (lmmode_bit & 2)
		{
			ShowSyncHudMsg(0, gmsgHudSync, "%L", LANG_PLAYER, messageshp[ random_num(0,MESSAGESHP-1) ],ite ,ict ,name,get_user_health(last))
		}

		else
		{
			ShowSyncHudMsg(0, gmsgHudSync, "%L", LANG_PLAYER, messagesnohp[ random_num(0,MESSAGESNOHP-1) ],ite ,ict ,name )
		}
	}

}
	return PLUGIN_CONTINUE   
}


public hs()
{
	new hsmode[4] 
	get_pcvar_string(hs_mode,hsmode,4) 
	new hsmode_bit = read_flags(hsmode)

	if (hsmode_bit & 1)
	{
	new killer_id = read_data(1)
	new victim_id = read_data(2)
	new victim_name[33]

	get_user_name(victim_id,victim_name,33)

	set_hudmessage(200, 100, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)
	ShowSyncHudMsg(killer_id, gmsgHudSync, "::HEADSHOT::^nYou Owned %s !!",victim_name)
	}

	if (hsmode_bit & 2)
	{
		for(new i=1;i<=get_maxplayers();i++) 
			if( is_user_connected(i)==1 )
				client_cmd(i,"spk misc/headshot")
	}
}

public plugin_precache()
{
	precache_sound("misc/fb.wav")
	precache_sound("misc/double.wav")
	precache_sound("misc/headshot.wav")
	precache_sound("misc/humiliation.wav")
	precache_sound("misc/kspree.wav")
	precache_sound("misc/quadra.wav")
	precache_sound("misc/penta.wav")
	precache_sound("misc/aced.wav")
	precache_sound("misc/rampage.wav")
	precache_sound("misc/triple.wav")
	precache_sound("misc/dominating.wav")
	precache_sound("misc/wickedsick.wav")
	precache_sound("misc/unstoppable.wav")
        
	return PLUGIN_CONTINUE 
}
LightGamin is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-26-2013 , 06:12   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #305

Does it work unmodified?
I think there may be a problem with using client_cmd() and the new CS 1.6 update.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
LightGamin
Member
Join Date: Apr 2011
Old 03-26-2013 , 15:26   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #306

It is possible, because it says that the plugin works when I type amx_plugins in the console.
Also when I connect to the server it downloads all the files through the sv_downloadurl (quadra.wav, penta.wav and so on), but in the game they don't play.
I'm scaring that some Upper-cases can cause this. So the files are Quadra.wav, Penta.wav, Rampage.wav - what do you think? I believe that there is he reason of this issue.
Also I renamed the plugin to gamesounds.sma
The counter-strike build is 4554
AMX X version is 1.8.1.3107 I think

THANK YOU VERY MUCH
LightGamin is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-26-2013 , 19:34   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #307

It doesn't matter what the files are called, it should be fine.

You can try them out by making sure you have them in your misc folder and then just type in console:
Code:
spk "misc/Quadra"
for instance.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
LightGamin
Member
Join Date: Apr 2011
Old 03-27-2013 , 11:47   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #308

But there is little difference. The sv_dlurl was not working as they was Quadra, Penta.. So I used Filezilla to change their name with lowercase and then all was fine with downloading, until I realized that they do not play in game. So the player's misc folder contains the files as follow - quadra.wav, penta.wav. But on the server they are Penta.wav, Quadra.wav and so on. The difference is little, but fortunately I can prove it seriously. Because one sound of the plugin - headshot.wav is default and it is with lowercase at the both places. And guess what, I remember that I heard it a couple of times, could it be so clear?
LightGamin is offline
DarkGod
SourceMod DarkCrab
Join Date: Jul 2007
Location: Sweden
Old 03-27-2013 , 20:25   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #309

It shouldn't be a problem. Try it out by renaming the files and everything if you'd like and if it works that's great but I just don't think that could be the cause of this problem.
__________________
DarkGod is offline
Send a message via AIM to DarkGod Send a message via MSN to DarkGod
LightGamin
Member
Join Date: Apr 2011
Old 03-29-2013 , 08:09   Re: Ultimate Sounds (More Addons for Misc. Stats) 2/18/10
Reply With Quote #310

Sure I will, once the service providers come to my home and set up the connection. It is that slow, because I requested co-location, instead of internet service. I will tell you all you need, after I test it several of times to fix it on my own. If I succeed, I will tell you how I did.

I know they don't work, because one friend started the server from his computer. But I can't give him again the flash drive, to test the server, when I expect internet staff to come in the next day.
LightGamin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode