Raised This Month: $12 Target: $400
 3% 

[REQ] Firstblood plugin ( Sound announcer)


Post New Thread Reply   
 
Thread Tools Display Modes
{NM}Jason
AMX Mod X Beta Tester
Join Date: Mar 2004
Location: Texas
Old 07-20-2006 , 01:43   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #11

i'm just using the wav you gave me now i wanted to do it every new round

heres the one i modded now using the one you modded now can you tell me why it says papare to fight every time some one connects and not just before the round start


Code:

#include <amxmodx>

#define KNIFFMESSAGES 4
#define LEVELS 7
#define MESSAGESNOHP 4
#define MESSAGESHP 4
#define MESSAGEFB 5

new kills[33] = {0,...};
new deaths[33] = {0,...};
new alone_ann = 0
new levels[11] = {2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22};
new firstblood

new stksounds[11][] = {
 "misc/MULTIK",
 "misc/ULTRAK",
 "misc/MONSTE",
 "misc/KILLIN",
 "misc/RAMPAGE",
 "misc/DOMINA",
 "misc/HOLYSH",
 "misc/UNSTOP",
 "misc/WICKED",
 "misc/LUDICR",
 "misc/GODLIKE"};

new stkmessages[11][] = {
 "%s: Multi-Kill!",
 "%s: Ultra-Kill!",
 "%s: Monster-Kill!",
 "%s: Killing Spree!",
 "%s: Rampage!",
 "%S: Dominating!",
 "%s: Holy Shit!",
 "%s: unstoppable!",
 "%s: Wicked Sick!",
 "%s: Ludicris kill!",
 "%s: Godlike!"}

new kniffmessages[KNIFFMESSAGES][] = {
"%s Sliced And Diced %s!",
"%s Shanked %s!",
"%s Pulled A Knife On %s!",
"%s Knived %s!"}

new messagesnohp[MESSAGESNOHP][] = {
"%i terrorist vs %i CT^n%s: Now All Depends On You!",
"%i terrorist vs %i CT^n%s: I Hope You Still Have A Healthpack.",
"%i terrorist vs %i CT^n%s: All Your Teammates Were Killed. Good Luck!",
"%i terrorist vs %i CT^n%s: Now You Are Alone. Have Fun!"}

new messageshp[MESSAGESHP][] = {
"%i terrorist vs %i CT^n%s (%i hp): Now All Depend On You!",
"%i terrorist vs %i CT^n%s (%i hp): I Hope You Still Have A Healthpack.",
"%i terrorist vs %i CT^n%s (%i hp): All Your Teammates Were Killed. Good Luck!",
"%i terrorist vs %i CT^n%s (%i hp): Now You Are alone. Have Fun!"}

new firstbloodmessages[MESSAGEFB][] = {
	"%s Drew First Blood!!!", 
	"%s Has Tasted Blood", 
	"%s BloodShot!!!", 
	"%s First Shot on tha Mark!",
	"%s FIRST BLOOD!!"
}

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

public death_event(id)
{
	
    	new killer = read_data(1);
    	new victim = read_data(2);
	
	if(firstblood && killer!=victim && killer>0) {
		
		new lin 
		new name[32]
		
		get_user_name(killer, name, 31)		
		lin = random_num(0, MESSAGEFB - 1)		
		
		set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)
		show_hudmessage(0, firstbloodmessages[lin], name)
		client_cmd(0,"spk misc/blood")
		firstblood = 0
		return PLUGIN_CONTINUE
	}
	
	new streak = get_streak()

	if ((streak&1) || (streak&2))
	{

    		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);
		show_hudmessage(0, stkmessages[level], name);
	}

	if (streak&2){
    		client_cmd(0, "spk %s", stksounds[level]);
	}
}

public reset_hud(id)
{
	if(get_cvar_num("firstblood_round"))
		firstblood = 1
	
	set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)
	show_hudmessage(0, "Prepare To Fight!")
	client_cmd(0,"spk misc/prepare")
	
	new streak = get_streak()

	if (streak&1)
	{

		if (kills[id] > levels[0])
		{
		        client_print(id, print_chat, 
			"* You are on a killstreak with %d kills.", kills[id]);

		}

		else if (deaths[id] > 1)
		{
			client_print(id, print_chat, 
			"* Take care, you are on a deathstreak with %d deaths in a row.", 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 kniffmode[4] 
	get_cvar_string("kniff_mode",kniffmode,4) 
	new kniffmode_bit = read_flags(kniffmode)

	if (kniffmode_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)
		show_hudmessage(0,kniffmessages[ random_num(0,KNIFFMESSAGES-1) ],killer_name,victim_name)
	}

	if (kniffmode_bit & 2)
	{
		client_cmd(0,"spk misc/humiliation")
   	}
}


public roundend_msg(id)

	alone_ann = 0

public death_msg(id)
{

	new lmmode[8] 
	get_cvar_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)
			{
				show_hudmessage(0,"%s (%i hp) vs. %s (%i hp)",name1,get_user_health(players_ct[0]),name2,get_user_health(players_t[0]))
			}

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

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

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

	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)
		{
			show_hudmessage(0,messageshp[ random_num(0,MESSAGESHP-1) ],ite ,ict ,name,get_user_health(last))
		}

		else
		{
			show_hudmessage(0,messagesnohp[ random_num(0,MESSAGESNOHP-1) ],ite ,ict ,name )
		}
	}

	if (lmmode_bit & 4)
	{
		client_cmd(last,"spk ")
	}
}
	return PLUGIN_CONTINUE   
}


public hs()
{
	new hsmode[4] 
	get_cvar_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)
	show_hudmessage(killer_id,"::HEADSHOT::^nYou Owned %s !!",victim_name)
	}

	if (hsmode_bit & 2)
	{
		client_cmd(0,"spk misc/headshot")
	}
}

public enable_firstblood(){
	firstblood = 1
}

public plugin_precache()
{
	//precache_sound("misc/maytheforce.wav")
	//precache_sound("misc/oneandonly.wav")
	precache_sound("misc/MULTIK.wav")
	precache_sound("misc/ULTRAK.wav")
	precache_sound("misc/MONSTE.wav")
	precache_sound("misc/KILLIN.wav")
	precache_sound("misc/RAMPAGE.wav")
	precache_sound("misc/DOMINA.wav")
	precache_sound("misc/HOLYSH.wav")
	precache_sound("misc/UNSTOP.wav")
	precache_sound("misc/GODLIKE.wav")
	precache_sound("misc/LUDICR.wav")
	precache_sound("misc/WICKED.wav")
	precache_sound("misc/HEADSH.wav")
	precache_sound("misc/HUMILI.wav")
	precache_sound("misc/PREPARE1.wav")
	precache_sound("misc/blood.wav")

	return PLUGIN_CONTINUE 
}



public plugin_init()
{
	register_plugin("Ultimate Sound","1.1","Dizzy")
	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")
	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")
	register_event("DeathMsg","death_msg","a")
	register_cvar("lastman_mode","abc")
	register_cvar("streak_mode","ab")
	register_cvar("kniff_mode","ab")
	register_cvar("hs_mode","ab")
	register_cvar("firstblood_round", "1")
	register_logevent("enable_firstblood",2, "1=Game_Commencing")
	return PLUGIN_CONTINUE
}
__________________
http://forums.alliedmods.net/showthr...396#post451396
Quote:
Originally Posted by BAILOPAN View Post
Shortly after posting that image, Jason crushed the truck into a ball with his hands, and tossed it over his shoulder.
{NM}Jason is offline
Send a message via ICQ to {NM}Jason Send a message via AIM to {NM}Jason Send a message via MSN to {NM}Jason Send a message via Yahoo to {NM}Jason
commonbullet
Veteran Member
Join Date: Oct 2005
Old 07-20-2006 , 02:01   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #12

This plugin is unlikely to get approved, it responds to a specific demand; furthermore it's described in "read before posting" new plugins.
Quote:
Some examples of plugins that will not be approved:
amx_slowhack (or any variant)
Any plugin that changes models to another, hardcoded model.
Any plugin that lets you play one sound in response to one event.
Any plugin that already exists.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
commonbullet
Veteran Member
Join Date: Oct 2005
Old 07-20-2006 , 02:10   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #13

Quote:
Originally Posted by RapHero2000
fuck it technichly it does more then plays a sound it asl odisplays difeant mesages .
If you are posting there anyway, please don't place me as an author. Give me some credits or karma.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
commonbullet
Veteran Member
Join Date: Oct 2005
Old 07-20-2006 , 09:16   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #14

This is the fix, nicely observed by Suicid3
Code:
#include <amxmodx> #define SOUND_FIRSTBLOOD "misc/firstblood.wav" #define SIZE_FBMESSAGES 5 new g_FirstBlood new g_FirstBloodMessages[SIZE_FBMESSAGES][] = {     "%s Drew First Blood!!!",     "%s Has Tasted Blood",     "%s BloodShot!!!",     "%s First Shot on tha Mark!",     "%s FIRST BLOOD!!" } public death_event(id) {     new killer = read_data(1);     new victim = read_data(2);         if(g_FirstBlood && killer!=victim && killer>0) {                new msgid         new name[32]                get_user_name(killer, name, 31)             msgid = random_num(0, SIZE_FBMESSAGES - 1)              set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)         show_hudmessage(0, g_FirstBloodMessages[msgid], name)               client_cmd(0,"spk %s", SOUND_FIRSTBLOOD)         g_FirstBlood = 0     } } public round_start() {     if(get_cvar_num("firstblood_round"))         g_FirstBlood = 1 } public enable_firstblood(){     g_FirstBlood = 1 } public plugin_init() {     register_logevent("enable_firstblood",2, "1=Game_Commencing")     register_event("DeathMsg", "death_event", "a")     register_cvar("firstblood_round", "1")     register_logevent("round_start", 2, "0=World triggered", "1=Round_Start") } public plugin_precache() {     precache_sound(SOUND_FIRSTBLOOD) }
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 12-25-2006 , 06:34   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #15

http://forums.alliedmods.net/showthread.php?t=48990
Simon Logic is offline
Send a message via Skype™ to Simon Logic
mitza_draku
Junior Member
Join Date: Jul 2006
Old 06-18-2007 , 12:55   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #16

Quote:
Originally Posted by commonbullet View Post
This is the fix, nicely observed by Suicid3
Code:

#include <amxmodx>

#define SOUND_FIRSTBLOOD "misc/firstblood.wav"
#define SIZE_FBMESSAGES 5

new g_FirstBlood
new g_FirstBloodMessages[SIZE_FBMESSAGES][] = {
"%s Drew First Blood!!!",
"%s Has Tasted Blood",
"%s BloodShot!!!",
"%s First Shot on tha Mark!",
"%s FIRST BLOOD!!"
}

public death_event(id) {

new killer = read_data(1);
new victim = read_data(2);

if(g_FirstBlood && killer!=victim && killer>0) {
new msgid
new name[32]
get_user_name(killer, name, 31)
msgid = random_num(0, SIZE_FBMESSAGES - 1)
set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)
show_hudmessage(0, g_FirstBloodMessages[msgid], name)
client_cmd(0,"spk %s", SOUND_FIRSTBLOOD)
g_FirstBlood = 0
}
}

public round_start() {
if(get_cvar_num("firstblood_round"))
g_FirstBlood = 1
}

public enable_firstblood(){
g_FirstBlood = 1
}

public plugin_init() {
register_logevent("enable_firstblood",2, "1=Game_Commencing")
register_event("DeathMsg", "death_event", "a")
register_cvar("firstblood_round", "1")
register_logevent("round_start", 2, "0=World triggered", "1=Round_Start")
}

public plugin_precache() {
precache_sound(SOUND_FIRSTBLOOD)
}


Hello. If i change the death_event to damage_event it will play first blood and the messages at the first damage? Or I have to do other changes?
Thx

Edit: i`ve tested with damage_event. Its not working. Can you make it to play the sounds and msgs at the first damage ? Thank you big time

Last edited by mitza_draku; 06-18-2007 at 13:01.
mitza_draku is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 06-18-2007 , 15:47   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #17

Congrats, you've unburied this one year old and useless cadaver with raphero traces.

Try this:
Code:
#include <amxmodx> #define SOUND_FIRSTBLOOD "misc/firstblood.wav" #define SIZE_FBMESSAGES 5 new g_FirstBlood new g_FirstBloodMessages[SIZE_FBMESSAGES][] = {     "%s Drew First Blood!!!",     "%s Has Tasted Blood",     "%s BloodShot!!!",     "%s First Shot on tha Mark!",     "%s FIRST BLOOD!!" } new g_cvarFirstBlood public dmg_event(victim) {         if(!g_FirstBlood)         return         new inflictor     new dmg         dmg = read_data(2)          inflictor = get_user_attacker(victim)         if(dmg && inflictor && (get_user_team(inflictor) != get_user_team(victim))) {                 new msgid         new name[32]                        get_user_name(inflictor, name, 31)              msgid = random_num(0, SIZE_FBMESSAGES - 1)                      set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)         show_hudmessage(0, g_FirstBloodMessages[msgid], name)               client_cmd(0,"spk %s", SOUND_FIRSTBLOOD)                 g_FirstBlood = 0     }       } public round_start() {     if(get_pcvar_num(g_cvarFirstBlood))         g_FirstBlood = 1 } public enable_firstblood(){     g_FirstBlood = 1 } public plugin_init() {      register_logevent("enable_firstblood",2, "1=Game_Commencing")     register_event("Damage", "dmg_event", "be")     register_logevent("round_start", 2, "0=World triggered", "1=Round_Start")         g_cvarFirstBlood = register_cvar("firstblood_round", "1") } public plugin_precache() {     precache_sound(SOUND_FIRSTBLOOD) }
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
mitza_draku
Junior Member
Join Date: Jul 2006
Old 06-19-2007 , 03:57   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #18

you are owsome ... thank you very much ... + karma


later edit: i have found a bug : if you first kill someone with a bullet, it will not play first blood, only when i just damage someone

Last edited by mitza_draku; 06-21-2007 at 01:12.
mitza_draku is offline
ismael9369
New Member
Join Date: Jun 2007
Old 06-26-2007 , 08:55   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #19

commonbullet, would you please be so kind to tell me or make me a firstblood.sma which plays different sounds everytime. i.e once it plays the normal firstblood.wav and the other time firstblood2.wav<-- this loops making it a pattern firstblood.wav then firstblood2.wav
Note: First blood should be played only once a round when a person is first killed not damaged, Thank You Very Much

++++ KARMA

Last edited by ismael9369; 06-26-2007 at 08:58.
ismael9369 is offline
commonbullet
Veteran Member
Join Date: Oct 2005
Old 06-26-2007 , 15:19   Re: [REQ] Firstblood plugin ( Sound announcer)
Reply With Quote #20

Try it, you should be able to add more than 2 sounds.
This is the last time I'm messing with this crap, please let it get drowned for the eternity.

Code:
#include <amxmodx> #define SIZE_FBMESSAGES 5 new const g_FirstBloodSound[][] = {"misc/firstblood.wav", "misc/firstblood2.wav"} new g_FirstBlood new g_FBIndex new g_SoundNum new g_FirstBloodMessages[SIZE_FBMESSAGES][] = {     "%s Drew First Blood!!!",     "%s Has Tasted Blood",     "%s BloodShot!!!",     "%s First Shot on tha Mark!",     "%s FIRST BLOOD!!" } public death_event(id) {     new killer = read_data(1);     new victim = read_data(2);         if(g_FirstBlood && killer!=victim && killer>0) {                new msgid         new name[32]                get_user_name(killer, name, 31)             msgid = random_num(0, SIZE_FBMESSAGES - 1)              set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)         show_hudmessage(0, g_FirstBloodMessages[msgid], name)                 client_cmd(0,"spk %s", g_FirstBloodSound[g_FBIndex++])                 if (g_FBIndex >= g_SoundNum)             g_FBIndex = 0         g_FirstBlood = 0     } } public reset_hud() {     if(get_cvar_num("firstblood_round"))         g_FirstBlood = 1 } public enable_firstblood(){     g_FirstBlood = 1 } public plugin_init() {     register_logevent("enable_firstblood",2, "1=Game_Commencing")     register_event("DeathMsg", "death_event", "a")     register_cvar("firstblood_round", "1")     register_event("ResetHUD", "reset_hud", "b")         g_SoundNum = sizeof g_FirstBloodSound } public plugin_precache() {     new len         len = sizeof g_FirstBloodSound     for(new i; i < len; i++)         precache_sound(g_FirstBloodSound[i]) }



Quote:
Originally Posted by mitza_draku View Post
later edit: i have found a bug : if you first kill someone with a bullet, it will not play first blood, only when i just damage someone
(this one is for mitza_draku)
Code:
#include <amxmodx> #define SOUND_FIRSTBLOOD "misc/firstblood.wav" #define SIZE_FBMESSAGES 5 new g_FirstBlood new g_FirstBloodMessages[SIZE_FBMESSAGES][] = {     "%s Drew First Blood!!!",     "%s Has Tasted Blood",     "%s BloodShot!!!",     "%s First Shot on tha Mark!",     "%s FIRST BLOOD!!" } new g_cvarFirstBlood public dmg_event(victim) {         if(!g_FirstBlood)         return         new inflictor     new dmg         dmg = read_data(2)          inflictor = get_user_attacker(victim)         if(dmg && inflictor && (get_user_team(inflictor) != get_user_team(victim)))         announce_fb(inflictor)     } public death_event(id) {     if(!g_FirstBlood)         return     new killer     new victim         killer = read_data(1)     victim = read_data(2)         if(g_FirstBlood && killer!=victim && killer>0)          announce_fb(killer) } public announce_fb(shooter) {     new msgid     new name[32]                get_user_name(shooter, name, 31)            msgid = random_num(0, SIZE_FBMESSAGES - 1)              set_hudmessage(200, 0, 0, -1.0, 0.30, 0, 3.0, 3.0, 0.15, 0.15, 1)     show_hudmessage(0, g_FirstBloodMessages[msgid], name)           client_cmd(0,"spk %s", SOUND_FIRSTBLOOD)         g_FirstBlood = 0 } public round_start() {     if(get_pcvar_num(g_cvarFirstBlood))         g_FirstBlood = 1 } public enable_firstblood(){     g_FirstBlood = 1 } public plugin_init() {         register_logevent("enable_firstblood",2, "1=Game_Commencing")     register_event("Damage", "dmg_event", "be")     register_event("DeathMsg", "death_event", "a")     register_logevent("round_start", 2, "0=World triggered", "1=Round_Start")         g_cvarFirstBlood = register_cvar("firstblood_round", "1") } public plugin_precache() {     precache_sound(SOUND_FIRSTBLOOD) }

Last edited by commonbullet; 06-26-2007 at 15:53.
commonbullet is offline
Send a message via ICQ to commonbullet Send a message via MSN to commonbullet
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 18:29.


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