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(client, Args)
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(menu, true);
DisplayMenu(menu, client, MENU_TIME_FOREVER);
}
public menuHandler(Handle:Menu, MenuAction:action, client, Select)
{
if (action == MenuAction_Select)
{
new String:info[256];
GetMenuItem(Menu, Select, info, 16);
EmitSoundToClient(client, MUSIC, _, _, _, _, _, _, _, _, _, _, GetGameTime() + StringToFloat(info));
if(StrEqual(info, "Off", false)) {
StopSound(client, SNDCHAN_AUTO, MUSIC);
}
}
if(action == MenuAction_End) CloseHandle(Menu);
}
public OnMapStart()
{
decl String:SampleString[256];
Format(SampleString, 256, "sound/%s", MUSIC);
AddFileToDownloadsTable(SampleString);
PrecacheSound(MUSIC);
}
public Action:OnPlayerRunCmd(client, &buttons, &impulse, Float: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?
__________________