Let's say you have a projectile datablock called MyProjectile. Start with the following code block, and add code to alter what happens when it collides with things.
function MyProjectile::onCollision(%this, %obj, %col, %fade, %pos, %normal)
{
parent::onCollision(%this, %obj, %col, %fade, %pos, %normal);
}
You can search for things in a radius with InitContainerRadiusSearch. A simple example that finds all players in a radius about an arbitrary point:
InitContainerRadiusSearch(%center, %radius, $Typemasks::PlayerObjectType);
while(%detected = containerSearchNext())
{
echo("Found " @ %detected @ " at position (" @ %detected.getPosition() @ ")");
}
Finally, the following function will play a sound at a given position.
serverPlay3d(MySound, %pos);