Raised This Month: $ Target: $400
 0% 

How to change this plugin?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Splifer
Junior Member
Join Date: Jun 2011
Old 06-23-2011 , 19:11   Re: How to change this plugin?
Reply With Quote #3

I'm really Noob in scripting
Now the script looks like this:

PHP Code:
#include <amxmodx>
#include <hamsandwich>
#define Maxsounds 10

new soundlist[Maxsounds][64]
new 
soundCount 0
new bool:music[33]

public 
plugin_init() {
    
register_plugin("Loading Music","0.9","Andrax2000")
    
RegisterHam(Ham_Spawn"player""fw_PlayerSpawn"1)
    return 
PLUGIN_CONTINUE
}

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

        
dh open_dir("sound/mindtricks"nameFull63)

        do
    {
                
strtok(nameFull,name,63,nameExt,31,'.')
                if (
equali(nameExt"mp3")) {

                        
soundlist[soundCount] = name
                        soundCount
++
                }
        }
    while(
soundCount<Maxsounds && next_file(dhnameFull63))
        
    
close_dir(dh)
    
server_print("[AMXX LOADING MUSIC] Found %i mp3s"soundCount)
    for (new 
0soundCounti++)
    {
        
format(name63"sound/mindtricks/%s.mp3",soundlist[i])
        
        
precache_generic(name)        
    }
    return 
PLUGIN_CONTINUE
}

public 
client_connect(id) {
    
music[id] = true;
    new 
i
    i 
random_num(0,soundCount-1)
    
client_cmd(id,"mp3 play sound/mindtricks/%s",soundlist[i])
    
}

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

And doesn't work - of course Music stops when a player is connected.
Help please?
__________________

Last edited by Splifer; 06-23-2011 at 19:26.
Splifer 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