Files
wnsrc/gamemodes/ixhl2rp/plugins/crystals/sh_plugin.lua

57 lines
1.6 KiB
Lua
Raw Normal View History

2024-08-04 23:12:27 +03:00
--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local PLUGIN = PLUGIN
PLUGIN.name = "Crystals"
PLUGIN.description = "A system that allows you to gather crystals!"
PLUGIN.author = "gb"
PLUGIN.version = 0.1
ix.util.Include("sv_hooks.lua")
ix.util.Include("sv_plugin.lua")
ix.config.Add("crystalSingularity", false, "Makes it so that singularities can be generated by crystals.", nil, {
category = "Crystals"
})
ix.config.Add("disableSuits", true, "Makes it so that blue crystals disable combine suits.", nil, {
category = "Crystals"
})
ix.command.Add("DestroyCrystal", {
alias = "BlowUpCrystal",
description = "Destroy the crystal entity you are looking at.",
adminOnly = true,
arguments = {
bit.bor(ix.type.bool, ix.type.optional)
},
OnRun = function(self, client, singularity)
local trace = client:GetEyeTrace()
local ent = trace.Entity
if IsValid(ent) and ent.Base == "crystal_base" then
if ent.OnDestroyed then
if singularity then
ent:OnDestroyed(true)
else
ent:OnDestroyed()
end
client:Notify("Destroyed the crystal entity you were looking at.")
else
client:Notify("The crystal cannot be destroyed.")
end
else
client:Notify("You are not looking at a valid crystal!")
end
end
})