Raised This Month: $ Target: $400
 0% 

How to change this plugin?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
2reason2kill
Senior Member
Join Date: Feb 2011
Old 06-23-2011 , 17:33   Re: How to change this plugin?
Reply With Quote #2

Quote:
Originally Posted by Splifer View Post
I want to use this plugin:
https://forums.alliedmods.net/showthread.php?t=46636

Music starts to play when player is connecting to server.
But stops when player is connected (he sees MOTD).
How do I change plugin to play Music until player Respawn OR join to team? (Without any breaks)

Here is code:

Code:
/* Loading Music (easy to use directory version)
by Andrew Penry (Andrax2000)
*/
#include <amxmodx>
#define Maxsounds 5
#define DEBUG 0

new soundlist[Maxsounds][64]
new soundCount = 0

public plugin_init() {
    register_plugin("Loading Music","0.9","Andrax2000")
    return PLUGIN_CONTINUE
}

public plugin_precache() {
        new dh
        new nameFull[64], name[64], nameExt[32]

        dh = open_dir("sound/misc/loading", nameFull, 63)

        do
    {
                strtok(nameFull,name,63,nameExt,31,'.')
                if (equali(nameExt, "mp3")) {
#if DEBUG==1
                        server_print("[AMXX LOADING MUSIC] Found %s ", nameFull)
#endif
                        soundlist[soundCount] = name
                        soundCount++
                }
        }
    while(soundCount<Maxsounds && next_file(dh, nameFull, 63))
        
    close_dir(dh)
    server_print("[AMXX LOADING MUSIC] Found %i mp3s", soundCount)
    for (new i = 0; i < soundCount; i++)
    {
        format(name, 63, "sound/misc/loading/%s.mp3",soundlist[i])
#if DEBUG==1
        server_print("[AMXX LOADING MUSIC] Precaching %s ", name)
#endif
        precache_generic(name)        
    }
    return PLUGIN_CONTINUE
}

public client_connect(id) {
    new i
    i = random_num(0,soundCount-1)
    client_cmd(id,"mp3 play sound/misc/loading/%s",soundlist[i])
    return PLUGIN_CONTINUE
}
Make a boolean?

Plox correct me If i where Wrong


Example:

PHP Code:
new bool:music[33]
public 
plugin_init()
{
       
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
}
Public 
Client_Connect (id)
{
        
music[id] = True;
}

public 
fw_PlayerSpawn (id)
{
       
music[id] = false;

2reason2kill is offline
 



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 23:26.


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