Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: Sound when the player connect and log in to server script.

  1. #1
    Private
    Join Date
    Jul 2016
    Location
    Albania
    Posts
    18
    Thanks
    8
    Thanked 9 Times in 8 Posts

    Sound when the player connect and log in to server script.

    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 !!!

  2. The Following 2 Users Say Thank You to klendi11 For This Useful Post:

    kevi07 (17th March 2017),kubislav23 (13th August 2016)

  3. #2
    Private First Class thOuMta's Avatar
    Join Date
    Oct 2012
    Location
    France
    Posts
    191
    Thanks
    139
    Thanked 35 Times in 28 Posts
    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

    I just remember this thing but i didnt tested it, so i dont know if is working

  4. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    dont put waits in there. Make it a thread instead.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  5. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (18th March 2017),thOuMta (13th August 2016)

  6. #4
    Private Wesleyw3zep's Avatar
    Join Date
    Feb 2016
    Posts
    38
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by thOuMta View Post
    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

    I just remember this thing but i didnt tested it, so i dont know if is working


    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);
    Last edited by Wesleyw3zep; 11th December 2016 at 05:47. Reason: sorry my bad i hope i do it good this time ?

  7. #5
    Private Wesleyw3zep's Avatar
    Join Date
    Feb 2016
    Posts
    38
    Thanks
    1
    Thanked 4 Times in 4 Posts
    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

  8. #6
    Private Lonsofore's Avatar
    Join Date
    Oct 2016
    Posts
    86
    Thanks
    82
    Thanked 38 Times in 25 Posts
    Quote Originally Posted by Wesleyw3zep View Post
    self playlocalsound("us_welcome.mp3"); //put your sound here
    Here is your mistake - you should use soundaliases (.csv) files for sounds. You can find an example in iw_06.iwd. So, make your own .csv file in "soundaliases" folder, add there your sounds and then use them in your code with given name.

  9. The Following User Says Thank You to Lonsofore For This Useful Post:

    kung foo man (18th March 2017)

  10. #7
    Private Wesleyw3zep's Avatar
    Join Date
    Feb 2016
    Posts
    38
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by Lonsofore View Post
    Here is your mistake - you should use soundaliases (.csv) files for sounds. You can find an example in iw_06.iwd. So, make your own .csv file in "soundaliases" folder, add there your sounds and then use them in your code with given name.
    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
    Last edited by Wesleyw3zep; 19th March 2017 at 01:39.

  11. #8
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    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 
    sudo apt-get rekt

  12. The Following User Says Thank You to voron00 For This Useful Post:

    kung foo man (19th March 2017)

  13. #9
    Private Wesleyw3zep's Avatar
    Join Date
    Feb 2016
    Posts
    38
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by voron00 View Post
    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 

  14. #10
    Corporal voron00's Avatar
    Join Date
    Nov 2014
    Posts
    248
    Thanks
    64
    Thanked 216 Times in 116 Posts
    Your colums is different than in stock iw_multiplayer.csv so adding that just like that won't work.

    Stock 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
    And your colums are:
    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
    So, the alias for your colums should be:
    Code:
    gomplayersleft,,,gomsound/playerdiscon.mp3,,,,,,,local,streamed,,,,all_mp,,,,,,local
    Last edited by voron00; 19th March 2017 at 08:56.
    sudo apt-get rekt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •