add sborka

This commit is contained in:
2026-03-31 10:27:04 +03:00
commit f5e5f56c84
2345 changed files with 382127 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
-- luacheck: ignore 111
--[[--
Class setup hooks.
As with `Faction`s, `Class`es get their own hooks for when players leave/join a class, etc. These hooks are only
valid in class tables that are created in `schema/classes/sh_classname.lua`, and cannot be used like regular gamemode hooks.
]]
-- @hooks Class
--- Whether or not a player can switch to this class.
-- @realm shared
-- @player client Client that wants to switch to this class
-- @treturn bool True if the player is allowed to switch to this class
-- @usage function CLASS:CanSwitchTo(client)
-- return client:IsAdmin() -- only admins allowed in this class!
-- end
function CanSwitchTo(client)
end
--- Called when a character has left this class and has joined a different one. You can get the class the character has
-- has joined by calling `character:GetClass()`.
-- @realm server
-- @player client Player who left this class
function OnLeave(client)
end
--- Called when a character has joined this class.
-- @realm server
-- @player client Player who has joined this class
-- @usage function CLASS:OnSet(client)
-- client:SetModel("models/police.mdl")
-- end
function OnSet(client)
end
--- Called when a character in this class has spawned in the world.
-- @realm server
-- @player client Player that has just spawned
function OnSpawn(client)
end

View File

@@ -0,0 +1,48 @@
-- luacheck: ignore 111
--[[--
Faction setup hooks.
Factions get their own hooks that are called for various reasons, but the most common one is to set up a character
once it's created and assigned to a certain faction. For example, giving a police faction character a weapon on creation.
These hooks are used in faction tables that are created in `schema/factions/sh_factionname.lua` and cannot be used like
regular gamemode hooks.
]]
-- @hooks Faction
--- Called when the default name for a character needs to be retrieved (i.e upon initial creation).
-- @realm shared
-- @player client Client to get the default name for
-- @treturn string Default name for the newly created character
-- @usage function FACTION:GetDefaultName(client)
-- return "MPF-RCT." .. tostring(math.random(1, 99999))
-- end
function GetDefaultName(client)
end
--- Called when a character has been initally created and assigned to this faction.
-- @realm server
-- @player client Client that owns the character
-- @char character Character that has been created
-- @usage function FACTION:OnCharacterCreated(client, character)
-- local inventory = character:GetInventory()
-- inventory:Add("pistol")
-- end
function OnCharacterCreated(client, character)
end
--- Called when a character in this faction has spawned in the world.
-- @realm server
-- @player client Player that has just spawned
function OnSpawn(client)
end
--- Called when a player's character has been transferred to this faction.
-- @realm server
-- @char character Character that was transferred
-- @usage function FACTION:OnTransferred(character)
-- character:SetModel(self.models[1])
-- end
function OnTransferred(character)
end

File diff suppressed because it is too large Load Diff