Author Topic: Music Scripting::Help  (Read 1127 times)

Alright, I realize that "canvas.pushDialog(WrenchSounddlg);" is to get the music and i can make a function cmd with that easily like such:

function serverCmdMusic(%client)
{
      canvas.pushDialog(WrenchSounddlg);
}

But im wondering how do you make that script so its host/sa/admin only?

« Last Edit: July 03, 2012, 11:00:24 AM by Gweedo »

not really an expert with this pushdiolog thing but the serverCmd will not work for anyone.

You need to do commandtoclient(%client,'stuffhere') and you should be able to find the stuffhere in trace

not really an expert with this pushdiolog thing but the serverCmd will not work for anyone.

You need to do commandtoclient(%client,'stuffhere') and you should be able to find the stuffhere in trace
Whats goes in Stuff Here

use trace to find out


their's a topic on it, but anyway if you do commandtoclient(%client,'openwrenchsounddlg'); it should open it but it might not work still

their's a topic on it, but anyway if you do commandtoclient(%client,'openwrenchsounddlg'); it should open it but it might not work still
What about the admin part.

you cant prevent the player from opening the GUI unless they don't have trust to you. Unless you find some way of packaging the fxDTSBrick::sendWrenchSoundData by breaking it

you cant prevent the player from opening the GUI unless they don't have trust to you. Unless you find some way of packaging the fxDTSBrick::sendWrenchSoundData by breaking it
Are you currently on blockland and have irc?

Code: [Select]
//give the script a brick to use
function servercmdsetmusicbrick(%client, %id)
{
if(%client.isHost)
$smmusicbrick = %id;
}
//allow someone to use it
function servercmdallowmusic(%client,%t)
{
if(!(%client.isHost || isobject(findclientbyname(%t))))
return;
announce("\c3" @ %client.name @ "\c6 allowed \c4" @ findclientbyname(%t).name @ "\c6 to set the music one time.");
findclientbyname(%t).cansetmusic = 1;
}
//push the wrench dlg
function servercmdmusic(%client)
{
if($musicrest == 0 && !%client.isHost && !%client.cansetmusic == 1)
return;
if($musicrest == 1 && !%client.isSuperAdmin && !%client.cansetmusic == 1)
return;
if(smusicrest == 2 && !%client.isAdmin && !%client.cansetmusic == 1)
return;
announce("\c3" @ %client.name @ "\c6 changes the music!");
if(%client.cansetmusic == 1)
%client.cansetmusic = 0;
%client.wrenchBrick = $smmusicbrick;
%client.wrenchBrick.sendWrenchSoundData(%client);
commandToClient(%client,'openWrenchSoundDlg',"Set Music",1);
}
Completely works
Looks eww though