Raised This Month: $ Target: $400
 0% 

Help me PLZ.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sQn
Member
Join Date: May 2007
Location: Poland, FtF Server :)
Old 11-06-2007 , 13:10   Help me PLZ.
Reply With Quote #1

Hey.Sry for my bad en. I wont sounds when user is disconnected, but i wont sounds if he was on stats list TAB PRESS [no he dowload my server files and disconnected, but play on my server and disconnected] Help me PLZ this is my plug-in:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fun>
#define PLUGIN "LeAvE SoUnDs"
#define VERSION "0.1"
#define AUTHOR "sQn"
#define MIN_LEAVE 0.1
#define MAX_LEAVE 6.0
new wital[33]
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("ResetHUD", "leave_event", "be")

}
public plugin_precache()
{
precache_sound("FtF/konczyc.wav")
precache_sound("FtF/naraska.wav")
precache_sound("FtF/3maj.wav")
precache_sound("FtF/cya.wav")
precache_sound("FtF/narka.wav")
precache_sound("FtF/elo.wav")
}
public client_putinserver( id )
{
wital[id] = 1
}

public client_disconnect( id )
{
wital[id] = 0
}
public client_connect( id )
{
wital[id] = 1
}
public leave_event(id)
{
if(!(wital[id] == 0))
{
set_task(random_float(MIN_LEAVE, MAX_LEAVE),"greetings",id)
wital[id] = 0
}
}
public greetings( id )
{
if (!(wital[id] == 0))
{
wital[id] = 0
new randomizer[33]
randomizer[id] = (random_num(1,6))

if(randomizer[id] == 1)
{
emit_sound(id, CHAN_AUTO, "FtF/konczyc.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
else if(randomizer[id] == 2)
{
emit_sound(id, CHAN_AUTO, "FtF/naraska.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
else if(randomizer[id] == 3)
{
emit_sound(id, CHAN_AUTO, "FtF/3maj.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
else if(randomizer[id] == 4)
{
emit_sound(id, CHAN_AUTO, "FtF/cya.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
else if(randomizer[id] == 5)
{
emit_sound(id, CHAN_AUTO, "FtF/narka.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}
else if(randomizer[id] == 6)
{
emit_sound(id, CHAN_AUTO, "FtF/elo.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)
}

}
return PLUGIN_HANDLED
}
__________________

80.52.244.150:27016
sQn is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-06-2007 , 13:52   Re: Help me PLZ.
Reply With Quote #2

I don't understand what you want exactly. When a player leaves there is a sound played ( To him or everyone? ). Also, whats the thing about players with stats?

try this though. This will play a sound on HIM leaving ot him.
Code:
#include <amxmodx>
#define PLUGIN "Leave Sounds"
#define VERSION "1.0"
#define AUTHOR "Amxx Community"


public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
}

public plugin_precache()
{
	precache_sound("FtF/konczyc.wav")
	precache_sound("FtF/naraska.wav")
	precache_sound("FtF/3maj.wav")
	precache_sound("FtF/cya.wav")
	precache_sound("FtF/narka.wav")
	precache_sound("FtF/elo.wav")
}

public client_disconnect(id)
{
	new rand = (random_num(1,6))

	if(rand == 1)
		emit_sound(id, CHAN_AUTO, "FtF/konczyc.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
	else if(rand == 2)
		emit_sound(id, CHAN_AUTO, "FtF/naraska.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
	else if(rand == 3)
		emit_sound(id, CHAN_AUTO, "FtF/3maj.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
	else if(rand == 4)
		emit_sound(id, CHAN_AUTO, "FtF/cya.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
	else if(rand == 5)
		emit_sound(id, CHAN_AUTO, "FtF/narka.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
	else if(rand == 6)
		emit_sound(id, CHAN_AUTO, "FtF/elo.wav", 1.0, ATTN_NORM, 0, PITCH_NORM) 
	
}
Styles is offline
Send a message via AIM to Styles
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-06-2007 , 14:12   Re: Help me PLZ.
Reply With Quote #3

Quote:
Originally Posted by styles View Post
Code:
public client_disconnect(id) {     new rand = (random_num(1,6))     if(rand == 1)         emit_sound(id, CHAN_AUTO, "FtF/konczyc.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     else if(rand == 2)         emit_sound(id, CHAN_AUTO, "FtF/naraska.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     else if(rand == 3)         emit_sound(id, CHAN_AUTO, "FtF/3maj.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     else if(rand == 4)         emit_sound(id, CHAN_AUTO, "FtF/cya.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     else if(rand == 5)         emit_sound(id, CHAN_AUTO, "FtF/narka.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     else if(rand == 6)         emit_sound(id, CHAN_AUTO, "FtF/elo.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)     }
This won't work. When client_disconnect is called, the player is disconnected.
ConnorMcLeod is offline
sQn
Member
Join Date: May 2007
Location: Poland, FtF Server :)
Old 11-06-2007 , 14:03   Re: Help me PLZ.
Reply With Quote #4

Quote:
Originally Posted by sQn View Post
I don't understand what you want exactly. When a player leaves there is a sound played ( To him or everyone? ). Also, whats the thing about players with stats?
I want sounds played for erveryone when player leaves server.
__________________

80.52.244.150:27016
sQn is offline
Old 11-06-2007, 14:29
fxfighter
This message has been deleted by fxfighter. Reason: gfaw
M249-M4A1
I <3 Mac
Join Date: May 2005
Location: Not interested
Old 11-06-2007 , 14:06   Re: Help me PLZ.
Reply With Quote #6

Um, I guess you could just change (in the original script)

This line
PHP Code:
emit_sound(idCHAN_AUTO"FtF/cya.wav"1.0ATTN_NORM0PITCH_NORM
To:
PHP Code:
client_cmd(0"spk ^"FtF/cya.wav^""
__________________
M249-M4A1 is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 11-06-2007 , 14:08   Re: Help me PLZ.
Reply With Quote #7

Quote:
Originally Posted by M249-M4A1 View Post
Um, I guess you could just change (in the original script)

This line
PHP Code:
emit_sound(idCHAN_AUTO"FtF/cya.wav"1.0ATTN_NORM0PITCH_NORM
To:
PHP Code:
client_cmd(0"spk ^"FtF/cya.wav^""

Dam you! I was doing that as we speek! StOP! GOD! M249 you must be really bored.

update:
Code:
#include <amxmodx>

#define PLUGIN "Leave Sounds"
#define VERSION "1.0"
#define AUTHOR "Amxx Community"


public plugin_init() 
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
}

public plugin_precache()
{
	precache_sound("FtF/konczyc.wav")
	precache_sound("FtF/naraska.wav")
	precache_sound("FtF/3maj.wav")
	precache_sound("FtF/cya.wav")
	precache_sound("FtF/narka.wav")
	precache_sound("FtF/elo.wav")
}

public client_disconnect(id)
{
	new rand = (random_num(1,6))

	if(rand == 1)
		client_cmd(0, "spk ^"FtF/konczyc.wav^"")
	else if(rand == 2)
		client_cmd(0, "spk ^"FtF/naraska.wav^"")
	else if(rand == 3)
		client_cmd(0, "spk ^"FtF/3maj.wav^"") 
	else if(rand == 4)
		client_cmd(0, "spk ^"FtF/cya.wav^"")
	else if(rand == 5)
		client_cmd(0, "spk ^"FtF/narka.wav^"")
	else if(rand == 6)
		client_cmd(0, "spk ^"FtF/elo.wav^"")
	
}
Does this work though M249,
emit_sound(0, CHAN_AUTO, "FtF/cya.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)

I wasn't sure so I didn't want to risk doing it since lol it wouldn't work.

Last edited by Styles; 11-06-2007 at 14:10.
Styles is offline
Send a message via AIM to Styles
sQn
Member
Join Date: May 2007
Location: Poland, FtF Server :)
Old 11-06-2007 , 14:31   Re: Help me PLZ.
Reply With Quote #8

But that beguile zrobic in order to played all [ it (him) ] plug-in dzialal.Ja che zeby dzwiek byl oprocz, when given player server opusci
__________________

80.52.244.150:27016
sQn is offline
Old 11-06-2007, 14:32
fxfighter
This message has been deleted by fxfighter. Reason: gfaw
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-06-2007 , 14:41   Re: Help me PLZ.
Reply With Quote #10

Something like this :

Code:
#include <amxmodx> #if AMXX_VERSION_NUM < 180     #define charsmax(%1)    sizeof(%1) - 1 #endif #define PLUGIN "Leave Sounds" #define VERSION "1.0" #define AUTHOR "Amxx Community" new const soundlist[][] = {     "konczyc.wav",     "naraska.wav",     "3maj.wav",     "cya.wav",     "narka.wav",     "elo.wav" } public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR) } public plugin_precache() {     new file[32]     for(new i; i<sizeof soundlist; i++)     {         formatex(file, charsmax(file), "FtF/%s", soundlist[i])         precache_sound(file)     } } public client_disconnect(id) {     new rand = random_num(0, charsmax(soundlist))     client_cmd(0, "spk FtF/%s", soundlist[rand]) }

Last edited by ConnorMcLeod; 11-06-2007 at 14:56.
ConnorMcLeod 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 01:23.


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