function Dgun(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement)
if weapon == 24 and hitElement and dgunStatus then
if getElementType(hitElement) == "vehicle" then
destroyElement(hitElement)
end
end
end
addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), Dgun )
addCommandHandler("dgun",
function()
dgunStatus = not dgunStatus
outputChatBox("Server: D-gun "..(dgunStatus and "On" or "Off").."!", 0, 255, 0, true)
end)