Originally Posted by
guiismiti
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
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
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();
and this is my callback_playerdisconnect
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();