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

[ANY] SoundCloud ( v1.7.3 Updated 7/10/2017 )


Post New Thread Reply   
 
Thread Tools Display Modes
Electr000999
Senior Member
Join Date: Aug 2011
Old 05-21-2015 , 03:32   Re: [ANY] SoundCloud
Reply With Quote #11

good start, i am start use your plugin on my servers.
  • please add change track pos with view current pos in menu
  • cvar default for sound volume for newbies without record in clientprefs
  • add plugin options in clientprefs settings menu (!settings) with volume and motd visible:

for example how it..
Code:
start at OnPluginStart..
         volume_cookie = RegClientCookie("sm_soundcloud_volume", "Soundcloud player volume  preference (0-10)", CookieAccess_Protected);
	SetCookieMenuItem(Menu_OptionsCookie, 0, "Soundcloud");
}

public Menu_OptionsCookie(client, CookieMenuAction:action, any:info, String:buffer[], maxlen) // sm_settings command.
{
	switch(action)
	{
		case CookieMenuAction_DisplayOption:
			Format(buffer, maxlen, "Soundcloud", client);
		case CookieMenuAction_SelectOption:
			ShowOptionsMenu(client);
	}
}

ShowOptionsMenu(client)
{
	ETC...
}

Last edited by Electr000999; 05-21-2015 at 03:43.
Electr000999 is offline
Send a message via Skype™ to Electr000999
nguyenbaodanh
AlliedModders Donor
Join Date: Jun 2007
Location: HCMC, Vietnam
Old 05-21-2015 , 04:59   Re: [ANY] SoundCloud
Reply With Quote #12

nvm ... i got it work now
__________________

Last edited by nguyenbaodanh; 05-21-2015 at 05:24.
nguyenbaodanh is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 05-21-2015 , 14:04   Re: [ANY] SoundCloud
Reply With Quote #13

Quote:
Originally Posted by Electr000999 View Post
good start, i am start use your plugin on my servers.
  • please add change track pos with view current pos in menu
  • cvar default for sound volume for newbies without record in clientprefs
  • add plugin options in clientprefs settings menu (!settings) with volume and motd visible:
Good points.
  1. I think a command to bring the motd window to front would do a better job (!scbring or !scopen). Gotta see if that's possible.
  2. Will do
  3. That's a possibility if people agree. I like to keep my code as simple as possible.
Alienmario is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 05-23-2015 , 12:52   Re: [ANY] SoundCloud
Reply With Quote #14

Hi, Many thanks for this plugin! Is it possible to add admin commands to play song for infected and survivors team (something like !scinf and !scsurv? This would be for L4D2, i've tried adding it myself but im not a coder so i was just messing with it hoping i will get it but no luck. I've tried adding something like this:

PHP Code:
if(IsClientInGame(i) || GetClientTeam(i) == TEAM_SURVIVOR){ 
and also
PHP Code:
 if(IsClientInGame(i) || IS_SURVIVOR(i)){ 
But neither of this worked, any tips

Last edited by midnight9; 05-26-2015 at 12:20.
midnight9 is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 05-23-2015 , 13:22   Re: [ANY] SoundCloud
Reply With Quote #15

Edit: replace || with &&

Both should work. Aren't you doing anything else wrong? Perhaps any console errors?

Basically, just copy OnScAll function twice, rename it and add the team specific check above.
Then, in OnPluginStart you duplicate line starting RegAdminCmd("sm_scall", OnScAll,... twice and change the command name and the function name for your new functions like this RegAdminCmd("sm_scsurv", OnScSurv

Last edited by Alienmario; 05-23-2015 at 13:26.
Alienmario is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 05-23-2015 , 13:29   Re: [ANY] SoundCloud
Reply With Quote #16

SOLVED

Last edited by midnight9; 05-25-2015 at 17:39.
midnight9 is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 05-23-2015 , 14:22   Re: [ANY] SoundCloud
Reply With Quote #17

That worked thanks One more thing, what is
PHP Code:
 c2PRIMARYc2SECONDARYclientc2PRIMARYargc2SECONDARYc2PRIMARYc2SECONDARY 
used for? If i want to change the print to chat line from
PHP Code:
[SoundCloud]%s Admin %N played %s%s%s. Use %s!scstop%s to stop playback
just to
PHP Code:
Use %s!scstop%s to stop playback
do i still keep the
PHP Code:
c2PRIMARYc2SECONDARYclientc2PRIMARYargc2SECONDARYc2PRIMARYc2SECONDARY 
Sorry if im asking dumb questions.

Last edited by midnight9; 05-23-2015 at 14:23.
midnight9 is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 05-23-2015 , 15:01   Re: [ANY] SoundCloud
Reply With Quote #18

It's for colors. You can just use
PHP Code:
PrintToChat(i"[SoundCloud]Use !scstop to stop playback."); 
in the for loop

Last edited by Alienmario; 05-23-2015 at 15:05.
Alienmario is offline
midnight9
Senior Member
Join Date: Nov 2012
Old 05-23-2015 , 15:27   Re: [ANY] SoundCloud
Reply With Quote #19

SOLVED

Last edited by midnight9; 05-25-2015 at 17:38.
midnight9 is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 06-03-2015 , 17:52   Re: [ANY] SoundCloud
Reply With Quote #20

New in version 1.5
- sm_sc_volume - new cvar for default volume (10 is default)
- !scopen, !scbring opens the playing motd window
- !schelp prints plugin commands to players
- chat messages now point to !schelp for more options.
Alienmario is offline
Reply


Thread Tools
Display Modes

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 16:13.


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