mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-27 20:43:02 +05:00
update readme
Fix collision Gamemodes menu in progress
This commit is contained in:
parent
0de4e84c48
commit
ae49f3ab04
8 changed files with 200 additions and 42 deletions
28
FIXES.md
28
FIXES.md
|
@ -1,20 +1,8 @@
|
|||
# Добавлено мной
|
||||
* Свой сервер онлайн курсов! Для получения API ключа пишите @Jonny_Bro#4226.
|
||||
* Разрешение Overdrive на сервере - *Beatrun_AllowOvedriveInMultiplayer*.
|
||||
* Измение цвета худа - *Beatrun_HUDTextColor*, *Beatrun_HUDCornerColor*, *Beatrun_HUDFloatingXPColor*.
|
||||
* Discord Rich Presence (Нужны модули из lua/bin)
|
||||
* Небольшой толчок камеры при нырянии.
|
||||
* Изменение максимальной скорости - *Beatrun_MaxSpeed* (Спасибо c4nk, я слепой).
|
||||
* Возможность удалять зиплайны от Zipline Gun на ПКМ.
|
||||
* Убран ваш SteamID в углу потому что могу.
|
||||
<br>
|
||||
# Фиксы с предыдущей версии
|
||||
* Обновление курсов под Cloudflare 🤡.
|
||||
<br>
|
||||
# Все фиксы
|
||||
* Сохранение курсов работает при сжатии и без.
|
||||
* Быстрый поворот только с руками бегуна (фикс поворотов при прицеливании и т.п.).
|
||||
* Ошибка при запуске курса.
|
||||
* Краш DataTheft при касании дата банка.
|
||||
* Использование кошки в курсах и режимах.
|
||||
* Сортировка таблицы лидеров выдавала ошибку.
|
||||
# All changes
|
||||
* Course saving works with compression and without.
|
||||
* Quick turnaround only with `Unarmed`.
|
||||
* Fixed leaderboard sorting in gamemodes.
|
||||
* Fixed grapple usage in courses and gamemodes.
|
||||
* Fixed DataTheft crash when touching data bank.
|
||||
* Fixed error when loading course.
|
||||
* Fixed collisions issues.
|
22
README.md
22
README.md
|
@ -1,5 +1,19 @@
|
|||
# beatrun by datae
|
||||
Extracted source code from of beatrun's DLL's.\
|
||||
Fixes: [click](https://github.com/JonnyBro/beatrun/blob/master/FIXES.md)
|
||||
# beatrun by datae <img src="https://cdn.discordapp.com/emojis/1022733627005620245.webp">
|
||||
Modified beatrun's source code.<br>
|
||||
|
||||
https://send.ephemeral.land/download/3585ba725ca36278/#NG_JZtPyTdlF_JXRUko5Ow
|
||||
There are lua modules, they are for Discord Rich Presence to work, if you want pure Lua just don't extract them, but your Level and Map will not be shown in your Discord status.
|
||||
|
||||
## Changes added by me
|
||||
* Custom online courses service! DM @Jonny_Bro#4226 for an API key.
|
||||
* Allow Overdrive usage on the server - `Beatrun_AllowOvedriveInMultiplayer`.
|
||||
* Change HUD's colors - `Beatrun_HUDTextColor`, `Beatrun_HUDCornerColor`, `Beatrun_HUDFloatingXPColor`.
|
||||
* Discord Rich Presence (extract `lua` folder to `garrysmod`, along side with `addons` folder).
|
||||
* Small camera punch when diving.
|
||||
* Change max moving speed - `Beatrun_MaxSpeed`.
|
||||
* Ability to remove ziplines that created with *Zipline Gun* - RMB.
|
||||
* Removed your SteamID from right corner, because I can.
|
||||
|
||||
## Fixes from previous version
|
||||
* Database update because Cloudflare 🤡.
|
||||
|
||||
### [All fixes](https://github.com/JonnyBro/beatrun/blob/master/FIXES.md)
|
|
@ -43,11 +43,11 @@ local function HideNearby(ply)
|
|||
end
|
||||
end
|
||||
|
||||
local offset = 15
|
||||
local offset = 25
|
||||
|
||||
if not pos then
|
||||
pos = ply:GetPos()
|
||||
offset = 80
|
||||
offset = 90
|
||||
end
|
||||
|
||||
pos.z = pos.z + offset
|
||||
|
|
|
@ -242,12 +242,9 @@ function PLAYER:Spawn()
|
|||
ply.SpawnFreezeTime = CurTime() + (1.75 * faststartmult)
|
||||
end
|
||||
|
||||
if not GetGlobalBool(GM_DATATHEFT) then
|
||||
ply:SetCollisionGroup(COLLISION_GROUP_WEAPON)
|
||||
ply:SetCustomCollisionCheck(true)
|
||||
else
|
||||
ply:SetCollisionGroup(COLLISION_GROUP_PLAYER)
|
||||
ply:SetCustomCollisionCheck(false)
|
||||
ply:SetCustomCollisionCheck(true)
|
||||
|
||||
if GetGlobalBool(GM_DATATHEFT) then
|
||||
ply:DataTheft_Bank()
|
||||
end
|
||||
|
||||
|
@ -304,14 +301,19 @@ hook.Add("SetupMove", "SpawnFreeze", function(ply, mv, cmd)
|
|||
end)
|
||||
|
||||
hook.Add("ShouldCollide", "NoPlayerCollisions", function(ent1, ent2)
|
||||
if ent1:IsPlayer() and (ent2:IsPlayer() or ent2.NoPlayerCollisions) then
|
||||
if ent2.BRCollisionFunc then
|
||||
return ent2:BRCollisionFunc(ent1)
|
||||
else
|
||||
return false
|
||||
end
|
||||
if ent1:IsPlayer() and ent2.NoPlayerCollisions then
|
||||
if ent2.BRCollisionFunc then return ent2:BRCollisionFunc(ent1)
|
||||
else return false end
|
||||
end
|
||||
|
||||
-- if ent1:IsPlayer() and (ent2:IsPlayer() or ent2.NoPlayerCollisions) then
|
||||
-- if ent2.BRCollisionFunc then
|
||||
-- return ent2:BRCollisionFunc(ent1)
|
||||
-- else
|
||||
-- return false
|
||||
-- end
|
||||
-- end
|
||||
|
||||
if ent2:IsPlayer() and ent1:IsNPC() then return true end
|
||||
end)
|
||||
|
||||
|
|
|
@ -14,12 +14,11 @@ if SERVER then
|
|||
net.Start("DataTheft_Start")
|
||||
net.Broadcast()
|
||||
|
||||
for k, v in ipairs(player.GetAll()) do
|
||||
for _, v in ipairs(player.GetAll()) do
|
||||
v:DataTheft_Bank()
|
||||
|
||||
v:SetNW2Int("DataCubes", 0)
|
||||
v:SetNW2Int("DataBanked", 0)
|
||||
v:SetCollisionGroup(COLLISION_GROUP_PLAYER)
|
||||
v:SetCustomCollisionCheck(false)
|
||||
|
||||
if v:GetMoveType() == MOVETYPE_NOCLIP then
|
||||
v:SetMoveType(MOVETYPE_WALK)
|
||||
|
@ -35,6 +34,12 @@ if SERVER then
|
|||
|
||||
function Beatrun_StopDataTheft()
|
||||
SetGlobalBool(GM_DATATHEFT, false)
|
||||
|
||||
for _, v in ipairs(player.GetAll()) do
|
||||
v:StripWeapons()
|
||||
v:StripAmmo()
|
||||
v:Give("runnerhands")
|
||||
end
|
||||
end
|
||||
|
||||
local function DataTheftSync(ply)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
hook.Add("PlayerButtonDown", "PlayerButtonDownWikiExample", function(ply, button)
|
||||
hook.Add("PlayerButtonDown", "CourseMenuBind", function(ply, button)
|
||||
if (game.SinglePlayer() or CLIENT and IsFirstTimePredicted()) and button == KEY_F4 then
|
||||
ply:ConCommand("Beatrun_CourseMenu")
|
||||
end
|
||||
|
|
147
beatrun/gamemodes/beatrun/gamemode/sh/Menu_Gamemodes.lua
Normal file
147
beatrun/gamemodes/beatrun/gamemode/sh/Menu_Gamemodes.lua
Normal file
|
@ -0,0 +1,147 @@
|
|||
if CLIENT then
|
||||
local gamemodePanel = {
|
||||
w = 1200,
|
||||
h = 650
|
||||
}
|
||||
|
||||
gamemodePanel.x = 960 - gamemodePanel.w * 0.5
|
||||
gamemodePanel.y = 540 - gamemodePanel.h * 0.5
|
||||
gamemodePanel.bgcolor = Color(32, 32, 32)
|
||||
gamemodePanel.outlinecolor = Color(54, 55, 56)
|
||||
gamemodePanel.alpha = 0.9
|
||||
gamemodePanel.elements = {}
|
||||
|
||||
local function closeButton()
|
||||
AEUI:Clear()
|
||||
end
|
||||
|
||||
local function infectionButton()
|
||||
net.Start("Beatrun_ToggleInfection")
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local function datatheftButton()
|
||||
net.Start("Beatrun_ToggleDataTheft")
|
||||
net.SendToServer()
|
||||
end
|
||||
|
||||
local loadoutnum = 1
|
||||
local maxloadoutnum = 1
|
||||
|
||||
local function createButton()
|
||||
net.Start("Beatrun_CreateLoadout")
|
||||
net.SendToServer()
|
||||
maxloadoutnum = maxloadoutnum + 1
|
||||
LocalPlayer():EmitSound("buttonclick.wav")
|
||||
end
|
||||
|
||||
local function resetloadoutButton()
|
||||
net.Start("Beatrun_ResetLoadouts")
|
||||
net.SendToServer()
|
||||
loadoutnum = 1
|
||||
maxloadoutnum = 1
|
||||
LocalPlayer():EmitSound("buttonclick.wav")
|
||||
end
|
||||
|
||||
local function leftButton()
|
||||
if loadoutnum ~= 1 then
|
||||
loadoutnum = loadoutnum - 1
|
||||
LocalPlayer():EmitSound("buttonclick.wav")
|
||||
end
|
||||
end
|
||||
|
||||
local function rightButton()
|
||||
if loadoutnum ~= maxloadoutnum then
|
||||
loadoutnum = loadoutnum + 1
|
||||
LocalPlayer():EmitSound("buttonclick.wav")
|
||||
end
|
||||
end
|
||||
|
||||
local function isSA()
|
||||
return not LocalPlayer():IsSuperAdmin()
|
||||
end
|
||||
|
||||
AEUI:AddText(gamemodePanel, "Gamemodes Select", "AEUIVeryLarge", 20, 30)
|
||||
AEUI:AddButton(gamemodePanel, " X ", closeButton, "AEUILarge", gamemodePanel.w - 47, 0)
|
||||
|
||||
local infectionbutton = AEUI:AddButton(gamemodePanel, "Toggle Infection", infectionButton, "AEUILarge", gamemodePanel.w - 330, gamemodePanel.h - 550)
|
||||
infectionbutton.greyed = isSA()
|
||||
local datatheftbutton = AEUI:AddButton(gamemodePanel, "Toggle Data Theft", datatheftButton, "AEUILarge", gamemodePanel.w - 330, gamemodePanel.h - 450)
|
||||
datatheftbutton.greyed = isSA()
|
||||
-- local loadoutbutton = AEUI:AddButton(gamemodePanel, "Create a new loadout", createButton, "AEUILarge", gamemodePanel.w - 330, gamemodePanel.h - 450)
|
||||
-- loadoutbutton.greyed = isSA()
|
||||
-- local resetbutton = AEUI:AddButton(gamemodePanel, "Resets all loadouts", resetloadoutButton, "AEUILarge", gamemodePanel.w - 330, gamemodePanel.h - 550)
|
||||
-- resetbutton.greyed = isSA()
|
||||
-- local leftloadout = AEUI:AddButton(gamemodePanel, " < ", leftButton, "AEUILarge", gamemodePanel.w - 225, gamemodePanel.h - 175)
|
||||
-- leftloadout.greyed = isSA()
|
||||
-- local rightloadout = AEUI:AddButton(gamemodePanel, " > ", rightButton, "AEUILarge", gamemodePanel.w - 150, gamemodePanel.h - 175)
|
||||
-- rightloadout.greyed = isSA()
|
||||
|
||||
-- AEUI:AddText(gamemodePanel, "Change through loadouts", "AEUILarge", gamemodePanel.w - 360, gamemodePanel.h - 125)
|
||||
|
||||
local weaponsList = {
|
||||
w = 800,
|
||||
h = 450,
|
||||
x = 979.2 - gamemodePanel.w * 0.5,
|
||||
y = 648 - gamemodePanel.h * 0.5,
|
||||
bgcolor = Color(32, 32, 32),
|
||||
outlinecolor = Color(54, 55, 56),
|
||||
alpha = 0.9,
|
||||
elements = {}
|
||||
}
|
||||
|
||||
function OpenGMMenu(ply)
|
||||
AEUI:AddPanel(gamemodePanel)
|
||||
AEUI:AddPanel(weaponsList)
|
||||
|
||||
for _, v in pairs(weapons.GetList()) do
|
||||
local weaponentry = AEUI:AddText(weaponsList, v.ClassName, "AEUILarge", 10, 40 * #weaponsList.elements)
|
||||
|
||||
function weaponentry:onclick()
|
||||
LocalPlayer():EmitSound("buttonclick.wav")
|
||||
end
|
||||
|
||||
weaponentry.greyed = sacheck
|
||||
end
|
||||
end
|
||||
|
||||
hook.Add("InitPostEntity", "GMMenuCommand", function()
|
||||
concommand.Add("Beatrun_GMMenu", OpenGMMenu)
|
||||
hook.Remove("InitPostEntity", "GMMenuCommand")
|
||||
end)
|
||||
|
||||
concommand.Add("Beatrun_GMMenu", OpenGMMenu)
|
||||
|
||||
hook.Add("PlayerButtonDown", "GMMenuBind", function(ply, button)
|
||||
if (game.SinglePlayer() or CLIENT and IsFirstTimePredicted()) and button == KEY_F3 then
|
||||
ply:ConCommand("Beatrun_GMMenu")
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if SERVER then
|
||||
util.AddNetworkString("Beatrun_ToggleDataTheft")
|
||||
util.AddNetworkString("Beatrun_ToggleInfection")
|
||||
|
||||
local datatheft, infection = false
|
||||
|
||||
net.Receive("Beatrun_ToggleDataTheft", function(_, ply)
|
||||
datatheft = not datatheft
|
||||
|
||||
if datatheft then
|
||||
Beatrun_StartDataTheft()
|
||||
else
|
||||
Beatrun_StopDataTheft()
|
||||
end
|
||||
end)
|
||||
|
||||
net.Receive("Beatrun_ToggleInfection", function(_, ply)
|
||||
infection = not infection
|
||||
|
||||
if infection then
|
||||
Beatrun_StartInfection()
|
||||
else
|
||||
Beatrun_StopInfection()
|
||||
end
|
||||
end)
|
||||
end
|
|
@ -3,5 +3,7 @@ DEFINE_BASECLASS("gamemode_base")
|
|||
function GM:PlayerSpawn(ply, transition)
|
||||
player_manager.SetPlayerClass(ply, "player_beatrun")
|
||||
|
||||
ply:StripAmmo()
|
||||
|
||||
BaseClass.PlayerSpawn(self, ply, transition)
|
||||
end
|
Loading…
Reference in a new issue