Author Topic: Is there a getmusic function?  (Read 737 times)

if there isn't, could someone make one er something?
How would i list the music to a client?
clientcmdchatmessageall(list_here);
something like that?



i don't think so

just make a function that reads off config/server/musiclist.cs
and than tell everyone the names of the ones that don't have -1 as their variable

i don't think so

just make a function that reads off config/server/musiclist.cs
and than tell everyone the names of the ones that don't have -1 as their variable

meh... doesnt like %this=strReplace(%this,"stuff",""); enough to do that..

meh... doesnt like %this=strReplace(%this,"stuff",""); enough to do that..

Nope, you need to use file functions.

You could go through dataBlockGroup and look for objects whose name starts with musicData_.

You could go through dataBlockGroup and look for objects whose name starts with musicData_.
On it.

for(%i  = 0; %i < dataBlockGroup.getCount() ; %i++)
{
   %datablock = dataBlockGroup.getObject(%i);
   if(getSubStr(%datablock.getName(),0,9) $="musicData")
      announce(%datablock.getName());
}

That is possibly the worst way of doing it, but you can give it a shot, I can't remember any string functions, haven't messed with Torque in ages.

Code: (basic declared function) [Select]
function echoMusicList()
{
echo("--Compiling Music List--");
for(%i  = 0; %i < dataBlockGroup.getCount() ; %i++)
{
%datablock = dataBlockGroup.getObject(%i);

if(getSubStr(%datablock.getName(),0,9) $="musicData")
{
%music = trim(%datablock.getName());
echo(%music);
}
}
echo("--Compiled Music List--");
}
« Last Edit: September 14, 2012, 02:51:08 PM by nerraD »