mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
39
gamemodes/darkrp/plugins/vortigaunts/meta/sh_character.lua
Normal file
39
gamemodes/darkrp/plugins/vortigaunts/meta/sh_character.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
--[[
|
||||
| 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 CHAR = ix.meta.character
|
||||
|
||||
function CHAR:IsVortigaunt()
|
||||
local faction = self:GetFaction()
|
||||
|
||||
if (faction == FACTION_VORT) then
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
function CHAR:HasVortalEnergy(amount)
|
||||
if self:GetVortalEnergy() and self:GetVortalEnergy() >= amount then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function CHAR:TakeVortalEnergy(amount)
|
||||
if self:GetPlayer():GetNetVar("ixVortExtract") then return end
|
||||
self:SetVortalEnergy(math.Clamp(self:GetVortalEnergy() - amount, 0, ix.config.Get("maxVortalEnergy", 100)))
|
||||
end
|
||||
|
||||
function CHAR:AddVortalEnergy(amount)
|
||||
if self:GetPlayer():GetNetVar("ixVortExtract") then return end
|
||||
self:SetVortalEnergy(math.Clamp(self:GetVortalEnergy() + amount, 0, ix.config.Get("maxVortalEnergy", 100)))
|
||||
end
|
||||
36
gamemodes/darkrp/plugins/vortigaunts/meta/sh_player.lua
Normal file
36
gamemodes/darkrp/plugins/vortigaunts/meta/sh_player.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
--[[
|
||||
| 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 playerMeta = FindMetaTable("Player")
|
||||
|
||||
function playerMeta:IsVortigaunt()
|
||||
return self:GetCharacter() and self:GetCharacter():IsVortigaunt()
|
||||
end
|
||||
|
||||
function playerMeta:HasVortalEnergy(amount)
|
||||
local character = self:GetCharacter()
|
||||
if character:GetVortalEnergy() and character:GetVortalEnergy() >= amount then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function playerMeta:TakeVortalEnergy(amount)
|
||||
if self:GetNetVar("ixVortExtract") then return end
|
||||
local character = self:GetCharacter()
|
||||
character:SetVortalEnergy(math.Clamp(character:GetVortalEnergy() - amount, 0, ix.config.Get("maxVortalEnergy", 100)))
|
||||
end
|
||||
|
||||
function playerMeta:AddVortalEnergy(amount)
|
||||
if self:GetNetVar("ixVortExtract") then return end
|
||||
local character = self:GetCharacter()
|
||||
character:SetVortalEnergy(math.Clamp(character:GetVortalEnergy() + amount, 0, ix.config.Get("maxVortalEnergy", 100)))
|
||||
end
|
||||
Reference in New Issue
Block a user