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

EmitSound Question (soundtime)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blowst
Senior Member
Join Date: Feb 2011
Location: Korea, Republic of
Old 09-10-2013 , 12:05  
Reply With Quote #1

I'd like to Emit BGM to client from a point i want.

but 14th parameter(soundtime) is limited to -42 ~ -40 (roughly)

so i cant start the BGM from a point further than 0:42.

how can i use this parameter without limit?

*Usage of soundtime: Alternate time to play sound for.

*I guess 'GetGameTime() - 10.0(or other float number)' is equal with '-10.0'

code here
PHP Code:
#include 
#include 

#define MUSIC "sample.mp3"

public OnPluginStart()
RegConsoleCmd("nightvision"cmdNightVision);

public 
Action:cmdNightVision(clientArgs)
MainMenu(client);

public 
MainMenu(client)
{
new 
Handle:menu CreateMenu(menuHandler);
SetMenuTitle(menu"soundtime TESTING");
AddMenuItem(menu"0.0""Default soundtime Value ON");
AddMenuItem(menu"-10.0""soundtime = GetGameTime() - 15.0 ON");
AddMenuItem(menu"-20.0""soundtime = GetGameTime() - 30.0 ON");
AddMenuItem(menu"-30.0""soundtime = GetGameTime() - 45.0 ON");
AddMenuItem(menu"-40.0""soundtime = GetGameTime() - 50.0 ON");
AddMenuItem(menu"-50.0""soundtime = GetGameTime() - 60.0 ON");
AddMenuItem(menu"Off""OFF a playing");
SetMenuExitButton(menutrue);
DisplayMenu(menuclientMENU_TIME_FOREVER);
}

public 
menuHandler(Handle:MenuMenuAction:actionclientSelect)
{
if (
action == MenuAction_Select)
{
new 
String:info[256];
GetMenuItem(MenuSelectinfo16);

EmitSoundToClient(clientMUSIC__________GetGameTime() + StringToFloat(info));

if(
StrEqual(info"Off"false)) {
StopSound(clientSNDCHAN_AUTOMUSIC);
}
}
if(
action == MenuAction_EndCloseHandle(Menu);
}

public 
OnMapStart()
{
decl String:SampleString[256];
Format(SampleString256"sound/%s"MUSIC);
AddFileToDownloadsTable(SampleString);
PrecacheSound(MUSIC);
}
public 
Action:OnPlayerRunCmd(client, &buttons, &impulseFloat:vel[3], Float:angles[3], &weapon)
{
if(
IsClientInGame(client) && IsClientConnected(client))
{
new 
Float:gettime;
gettime GetGameTime();
PrintCenterText(client"%.3f"gettime);
}

Sorry for my bad English :∑

No one knows? or is it just a bug else hardcoded on source engine?

No one knows?
else... is it just a bug? or has the parameter been hardcoded to limit the value?
__________________
Sorry about my poor English


Last edited by thetwistedpanda; 09-12-2013 at 10:49. Reason: double post
Blowst 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 05:55.


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