function gameConnection::zunhaalviik(%this) // make sure to pass the client { if(!isObject(%this) || !isObject(%p = %this.player)) return; %radius = 5; //the radius in which to disarm other players initContainerRadiusSearch(%p.getPosition(), %radius, $TypeMasks::PlayerObjectType); //the object is the first word in the raycast %ray = getWord(containerSearchNext(),0); if(%ray $= %p) //Prevents the player using the weapon being affected as well %ray = getWord(containerSearchNext(),0); while(isObject(%ray)) { if(isObject(%ray.getMountedImage(0))) { %ray.tool[%ray.currTool] = 0; %ray.weaponCount--; messageClient(%ray.client,'MsgItemPickup','[insert a message if you choose]',%ray.currTool,0); // CHANGE %ray.unmountImage(0); } %ray = getWord(containerSearchNext(),0); if(%ray $= %p) //Prevents the player using the weapon being affected as well %ray = getWord(containerSearchNext(),0); } } function serverCmdZunHaalViik(%client) { %client.zunhaalviik(); }