Hi guys
Can anyone tell me the way or the script that play a sound when the player log in.
like : "Welcome to X mod" when the player log in.
If anyone help or give his thoughts that would be great !!!
Printable View
Hi guys
Can anyone tell me the way or the script that play a sound when the player log in.
like : "Welcome to X mod" when the player log in.
If anyone help or give his thoughts that would be great !!!
I just remember this thing but i didnt tested it, so i dont know if is working :)PHP Code:
Callback_PlayerConnect()
{
level notify("connected", self);
if(!level.splitscreen)
iprintln(&"MP_CONNECTED", self.name);
self iprintlnbold("Welcome to X mod"); //put your message here
wait(0.5);
self playlocalsound("YOUR_WELCOME_SOUND"); //put your sound here
}
dont put waits in there. Make it a thread instead.
Callback_PlayerConnect()
{
thread dummy();
self.statusicon = "hud_status_connecting";
self waittill("begin");
self.statusicon = "";
level notify("connected", self);
if(!level.splitscreen)
iprintln(&"MP_CONNECTED", self.name);
self iprintlnbold("^3Welcome to unionsqd-gaming "); //put your message here
self playlocalsound("us_welcome.mp3"); //put your sound here
//PAM TEMP!
self.pers["dvarenforcement"] = 1;
//self setclientcvar("hud_enable", 1);
well i did this,
Callback_PlayerConnect()
{
thread dummy();
self.statusicon = "hud_status_connecting";
self waittill("begin");
self.statusicon = "";
level notify("connected", self);
if(!level.splitscreen)
iprintln(&"MP_CONNECTED", self.name);
self iprintlnbold("^5w^6w^7w^3.^1unionsqd-gaming^3.^7c^6o^5m"); //put your message here
self playlocalsound("us_welcome.mp3"); //put your sound here
//self setclientcvar("hud_enable", 1);
if(!isdefined(self.pers["team"]) && !level.splitscreen)
iprintln(&"MP_CONNECTED", self.name);
lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
logPrint("J;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");
but i hear no sound only see the text
ok so in the map sound i made a map called ''Gomsound'' inside that map are the 2 mp3's called ''playercon & playerdiscon.mp3
#Gomannouncer,,,,,,,,,,,,
gomplayersleft,,,gomsound/playerdiscon.mp3,1,1,,,,1000000,,auto,streamed
gomplayersjoined,,,gomsound/playercon.mp3,1,1,,,,1000000,,auto,streamed
does not work :(
auto is a 3d channel, it cannot be used to play a local sound, use something like (but make sure it matches your soundalias columns):
PHP Code:
gomplayersleft,,gomsound/playerdiscon.mp3,,,,,,,,local,streamed,,,,all_mp,,,,,,local
so like this ??PHP Code:
name,sequence,probability,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage
hill400_assault_gr5_letsgoget,,,Voiceovers/US/400Assault/hill400assault_gr5_sc03_01_t1.wav,1,1,,,,1000000,,auto,streamed
soviet_victory_light01,,,music/downtownsniper_victory_GRFINAL.mp3,1,1,,,,1000000,,auto,streamed
ridge88_main_music,,,music/88ridge_approaching_ridge2_GRFINAL.mp3,1,1,,,,1000000,,auto,streamed
gomplayersleft,,gomsound/playerdiscon.mp3,,,,,,,,local,streamed,,,,all_mp,,,,,,local
Your colums is different than in stock iw_multiplayer.csv so adding that just like that won't work.
Stock colums are:And your colums are:Code:name,sequence,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,probability,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage
So, the alias for your colums should be:Code:name,sequence,probability,file,vol_min,vol_max,vol_mod,pitch_min,pitch_max,dist_min,dist_max,channel,type,loop,masterslave,loadspec,subtitle,compression,secondaryaliasname,volumefalloffcurve,startdelay,speakermap,reverb,lfe percentage
Code:gomplayersleft,,,gomsound/playerdiscon.mp3,,,,,,,local,streamed,,,,all_mp,,,,,,local
oke i understand so if i paste this code
in iw_multiplayer.csv it will be ok?PHP Code:
gomplayersleft,,,gomsound/playerdiscon.mp3,,,,,,,local,streamed,,,,all_mp,,,,,,local
and where can i paste that @ the begin of the csv o
No, if you want to use iw_multiplayer.csv, you should use:
And if you want to use it with your soundalias file with the columns you posted you should use:PHP Code:
gomplayersleft,,gomsound/playerdiscon.mp3,,,,,,,,local,streamed,,,,all_mp,,,,,,local
PHP Code:
gomplayersleft,,,gomsound/playerdiscon.mp3,,,,,,,local,streamed,,,,all_mp,,,,,,local
ok ok Thank you!
i will try this now. ( just to get you a idea do u know the extreme mod @ cod2) ? thats the thing what i want when someone joins and leaves the server you will hear that sound everybody will hear that sound. you know what i mean?
In the game type script (tdm.gsc, dm.gsc, sd.gsc, ...), use playSoundOnPlayers(sound, team) on Callback_PlayerConnect() and Callback_PlayerDisconnect()
well this is my player_connect
and this is my callback_playerdisconnectPHP Code:
Callback_PlayerConnect()
{
thread dummy();
self.statusicon = "hud_status_connecting";
self waittill("begin");
self.statusicon = "";
level notify("connected", self);
self iprintlnbold("You are connected to unionsqd-gaming public SD"); //put your message here
self playlocalsound("playercon.mp3"); //put your sound here
if(!isdefined(self.pers["team"]) && !level.splitscreen)
iprintln(&"MP_CONNECTED", self.name);
self playlocalsound("playercon.mp3"); //put your sound here
lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
logPrint("J;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");
if(game["state"] == "intermission")
{
spawnIntermission();
return;
}
level endon("intermission");
// WORM
self thread maps\mp\gametypes\_wormsmod::Worms_Mod_PlayerConnect_Init();
PHP Code:
Callback_PlayerDisconnect()
{
if(!level.splitscreen)
iprintln(&"MP_DISCONNECTED", self);
self playlocalsound("playerdiscon.mp3"); //put your sound here
if(isdefined(self.pers["team"]))
{
if(self.pers["team"] == "allies")
setplayerteamrank(self, 0, 0);
else if(self.pers["team"] == "axis")
setplayerteamrank(self, 1, 0);
else if(self.pers["team"] == "spectator")
setplayerteamrank(self, 2, 0);
}
lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
logPrint("Q;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");
if(game["matchstarted"])
level thread updateTeamStatus();
read what I posted and try doing it as I said
Like this?
PHP Code:
Callback_PlayerConnect()
{
thread dummy();
self.statusicon = "hud_status_connecting";
self waittill("begin");
self.statusicon = "";
level notify("connected", self);
self iprintlnbold("You are connected to unionsqd-gaming public SD"); //put your message here
playSoundOnPlayers(sound, team)("playercon.mp3"); //put your sound here
if(!isdefined(self.pers["team"]) && !level.splitscreen)
iprintln(&"MP_CONNECTED", self.name);
self playlocalsound("playercon.mp3"); //put your sound here
lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
logPrint("J;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");
if(game["state"] == "intermission")
{
spawnIntermission();
return;
}
level endon("intermission");
// WORM
self thread maps\mp\gametypes\_wormsmod::Worms_Mod_PlayerConnect_Init();
PHP Code:
Callback_PlayerDisconnect()
{
if(!level.splitscreen)
iprintln(&"MP_DISCONNECTED", self);
self playlocalsound("playerdiscon.mp3"); //put your sound here
if(isdefined(self.pers["team"]))
{
if(self.pers["team"] == "allies")
setplayerteamrank(self, 0, 0);
else if(self.pers["team"] == "axis")
setplayerteamrank(self, 1, 0);
else if(self.pers["team"] == "spectator")
setplayerteamrank(self, 2, 0);
}
lpselfnum = self getEntityNumber();
lpselfguid = self getGuid();
logPrint("Q;" + lpselfguid + ";" + lpselfnum + ";" + self.name + "\n");
if(game["matchstarted"])
level thread updateTeamStatus();
Instead of
useCode:playSoundOnPlayers(sound, team)("playercon.mp3");
and delete this:Code:playSoundOnPlayers("playercon.mp3", team);
But also, you need to add your sound to a soundaliases table and use the alias instead of the file name.Code:self playlocalsound("playercon.mp3");
It will help you if you get a mod and check how it is done.
So what you say to me is that i cant use the.multiplayer soundaliases? Pff this is harder than i thought
Ofcourse you can use that one. But you need to use that syntax. Just copy a line that plays a sound to all players and edit it
well i have this
in my ''iw_multiplayer2_csvPHP Code:
#Misc,,,,,,,,,,,,,,,,,,,,,
beep,1,misc/beep.wav,,,,,,,,,,,,,all_mp,,,,,,
gomplayersleft,,gomsound/playerdiscon.mp3,,,,,,,,local,streamed,,,,all_mp,,,,,,local
gomplayersjoined,,gomsound/playercon.mp3,,,,,,,,local,streamed,,,,all_mp,,,,,,local playercon.mp3
That does not show anything. That's like saying your car has 2 doors and 4 tires, but not telling where they're connected to the car.