Raised This Month: $51 Target: $400
 12% 

mp3 connect sound


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SniperSK
Junior Member
Join Date: Aug 2018
Location: Slovakia
Old 10-29-2018 , 07:42   mp3 connect sound
Reply With Quote #1

Hello everyone, Im new here.
I need your help with this plugin, link for plugin - here

Problem is if starts new round even when no player joins the server sound play and spamming

Can someone solve my problem?

Spoiler


And can someone make only for VIP/ADMIN play sound?
Thanks

PS : Sorry for my bad english

Last edited by SniperSK; 10-29-2018 at 07:44.
SniperSK is offline
E1_531G
Senior Member
Join Date: Dec 2017
Old 10-29-2018 , 08:50   Re: mp3 connect sound
Reply With Quote #2

Add a simple check for players number: if( get_playersnum() == 0 ) return;
__________________
My English is A0
E1_531G is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 10-29-2018 , 08:51   Re: mp3 connect sound
Reply With Quote #3

Like this?
PHP Code:
#include <amxmodx> 
#include <amxmisc> 

#define PLUGIN "Nowy Plugin" 
#define VERSION "1.0" 
#define AUTHOR "xbatista" 

#define isVip(%0) (get_user_flags (%0) & ADMIN_BAN)

new const music[][] = 

    
"sound/misc/join5.mp3",
    
"misc/residentevil.mp3"


public 
plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR)  

public 
plugin_precache()  

    new 

    
for(0sizeof (music); i++)
    
precache_sound(music[i])  



public 
client_putinserver(id)

    if(
isVip(id))
        
client_cmd(id"mp3 play %s"music[random_num(0,1)])

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
SniperSK
Junior Member
Join Date: Aug 2018
Location: Slovakia
Old 10-29-2018 , 09:42   Re: mp3 connect sound
Reply With Quote #4

Quote:
Originally Posted by iceeedr View Post
Like this?
PHP Code:
#include <amxmodx> 
#include <amxmisc> 

#define PLUGIN "Nowy Plugin" 
#define VERSION "1.0" 
#define AUTHOR "xbatista" 

#define isVip(%0) (get_user_flags (%0) & ADMIN_BAN)

new const music[][] = 

    
"sound/misc/join5.mp3",
    
"misc/residentevil.mp3"


public 
plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR)  

public 
plugin_precache()  

    new 

    
for(0sizeof (music); i++)
    
precache_sound(music[i])  



public 
client_putinserver(id)

    if(
isVip(id))
        
client_cmd(id"mp3 play %s"music[random_num(0,1)])

Hi, if I want compile this,1error -
Code:
mp3connect.sma(33) : error 054: unmatched closing brace

1 Error.
Compile failed!
Need a fix?
SniperSK is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 10-29-2018 , 09:52   Re: mp3 connect sound
Reply With Quote #5

Line 33 is the last brace "}", you forgot to copy it.

Code:
AMX Mod X Compiler 1.9.0.5229
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Header size:            312 bytes
Code size:              456 bytes
Data size:              348 bytes
Stack/heap size:      16384 bytes
Total requirements:   17500 bytes
Done.
Attached Files
File Type: sma Get Plugin or Get Source (ConnectSound.sma - 449 views - 789 Bytes)
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 10-29-2018 at 09:53.
iceeedr is offline
Send a message via Skype™ to iceeedr
SniperSK
Junior Member
Join Date: Aug 2018
Location: Slovakia
Old 10-29-2018 , 10:07   Re: mp3 connect sound
Reply With Quote #6

Yes its compiled,but sound not play now
SniperSK is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 10-29-2018 , 10:12   Re: mp3 connect sound
Reply With Quote #7

Code:
new const music[][] = 
{ 
    "sound/misc/join5.mp3",
    "misc/residentevil.mp3"
}
You have to correctly put the path of your sounds, and make sure they are in mp3 and "calibrated" to play in HL1 mods, google it on, other than that, the code should work normally.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
SniperSK
Junior Member
Join Date: Aug 2018
Location: Slovakia
Old 10-29-2018 , 10:33   Re: mp3 connect sound
Reply With Quote #8

Code:
new const music[][] = 
{ 
    "sound/misc/star-wars.mp3",
    "sound/misc/star-wars.mp3"
}
like this?

And sorry for that,im new in amxx
SniperSK is offline
Old 10-29-2018, 11:35
iceeedr
This message has been deleted by iceeedr. Reason: error
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 10-29-2018 , 11:40   Re: mp3 connect sound
Reply With Quote #9

PHP Code:
#include <amxmodx> 
#include <amxmisc> 

#define PLUGIN "Nowy Plugin" 
#define VERSION "1.0" 
#define AUTHOR "xbatista" 

#define isVip(%0) (get_user_flags (%0) & ADMIN_BAN)

new const music[][] = 

    
"sound/misc/star-wars.mp3",
    
"sound/misc/star-wars.mp3"


public 
plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR)  

public 
plugin_precache()  

    new 

    
for(0sizeof (music); i++)
    
precache_generic(music[i])  



public 
client_putinserver(id)

    if(
isVip(id))
        
client_cmd(id"mp3 play %s"music[random_num(0,1)])

I made a mistake, for mp3 need to use precache_generic and not the sound, check the code above if this is ok for you.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
SniperSK
Junior Member
Join Date: Aug 2018
Location: Slovakia
Old 10-29-2018 , 11:58   Re: mp3 connect sound
Reply With Quote #10

Yes,sound actually downloaded from server,but sound not play What mistake im doing?
SniperSK is offline
Reply



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 03:35.


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