I was changing around Blockombat's M9A1 script so every time it shoots; it plays a random distant gunshot sound 2D to the whole server.
I'm obviously a noob or something because I cant even get this to work.
This is what I am putting, Any ideas?
function BerettaM9A1Image::OnFire(%this, %obj, %slot)
{
Parent::onFire(%this, %obj, %slot);
%random = getRandom(1,3);
switch(%random)
{
case 1:
serverplay2d(M9A1Distant1);
case 2:
serverplay2d(M9A1Distant2);
case 3:
serverplay2d(M9A1Distant3);
default:
echo("Error on M9A1");
}
}
Also, If I edit this script it has a problem with this. If I don't edit the script it works just fine.
function servercmdDropTool(%client,%slot)
{
if(%client.player.getMountedImage(0) $= BerettaM9ADSImage.getID())
{
%client.player.unmountImage(0);
%client.setControlCameraFov(90);
if($BKT::CH)
{
crossHair.setBitmap("base/client/ui/crosshair.png");
}
}
##r##eturn Parent::servercmdDropTool(%client,%slot);
}
};