mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
57
gamemodes/ixhl2rp/plugins/crystals/sh_plugin.lua
Normal file
57
gamemodes/ixhl2rp/plugins/crystals/sh_plugin.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
--[[
|
||||
| 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
|
||||
})
|
||||
Reference in New Issue
Block a user