This commit is contained in:
lifestorm
2024-08-04 22:55:00 +03:00
parent 8064ba84d8
commit 73479cff9e
7338 changed files with 1718883 additions and 14 deletions

View File

@@ -0,0 +1,82 @@
--[[
| 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/
--]]
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
AddCSLuaFile("shared.lua")
include('shared.lua')
/*--------------------------------------------------
*** Copyright (c) 2012-2023 by DrVrej, All rights reserved. ***
No parts of this code or any of its contents may be reproduced, copied, modified or adapted,
without the prior written consent of the author, unless otherwise indicated for stand-alone materials.
--------------------------------------------------*/
ENT.PainSoundT = 0
util.AddNetworkString("vj_testentity_onmenuopen")
util.AddNetworkString("vj_testentity_runtextsd")
---------------------------------------------------------------------------------------------------------------------------------------------
function ENT:Initialize()
self:SetModel("models/humans/group01/male_0" .. math.random(1, 9) .. ".mdl")
self:SetSpawnEffect(false)
self:SetHullType(HULL_HUMAN)
self:SetHullSizeNormal()
self:SetNPCState(NPC_STATE_SCRIPT)
self:SetSolid(SOLID_BBOX)
self:SetUseType(SIMPLE_USE) -- Makes the ENT.Use hook only get called once at every use.
self:DropToFloor()
self:SetMaxYawSpeed(20)
self:CapabilitiesAdd(bit.bor(CAP_ANIMATEDFACE, CAP_TURN_HEAD, CAP_MOVE_GROUND, CAP_OPEN_DOORS, CAP_AUTO_DOORS, CAP_MOVE_JUMP))
end
---------------------------------------------------------------------------------------------------------------------------------------------
function ENT:SelectSchedule()
for _, v in ipairs(ents.FindInSphere(self:GetPos(), 150)) do
if v:IsPlayer() && v:Alive() then
self:SetSchedule(SCHED_IDLE_STAND)
self:SetSchedule(SCHED_TARGET_FACE)
return
end
end
self:SetSchedule(SCHED_IDLE_WANDER)
end
---------------------------------------------------------------------------------------------------------------------------------------------
function ENT:OnTakeDamage()
if CurTime() > self.PainSoundT then
self:EmitSound("vo/npc/male01/pain0"..math.random(1,9)..".wav")
self.PainSoundT = CurTime() + 1
self:SetSchedule(SCHED_RUN_FROM_ENEMY)
end
return 0
end
---------------------------------------------------------------------------------------------------------------------------------------------
function ENT:AcceptInput(key, activator, caller)
if key == "Use" && activator:IsPlayer() && activator:IsValid() && activator:Alive() then
net.Start("vj_testentity_onmenuopen")
net.Send(activator)
self:EmitSound("vj_misc/illuminati_confirmed.mp3", 75)
self:EmitSound("vo/npc/male01/hi0"..math.random(1,2)..".wav")
self:SetTarget(activator)
self:SetSchedule(SCHED_IDLE_STAND)
self:SetSchedule(SCHED_TARGET_FACE)
end
end
---------------------------------------------------------------------------------------------------------------------------------------------
net.Receive("vj_testentity_runtextsd", function(len, ply)
local msgType = net.ReadBool()
if (ply:IsPlayer() && ply:SteamID() == "STEAM_0:0:22688298") or (game.SinglePlayer() == true) then
msg = (msgType == true and "Are you thirsty?") or "DrVrej is in this server, be aware!"
sdFile = (msgType == true and "vj_misc/areyouthristy.wav") or "vj_misc/illuminati_confirmed.mp3"
PrintMessage(HUD_PRINTTALK, msg)
PrintMessage(HUD_PRINTCENTER, msg)
local filter = RecipientFilter()
filter:AddAllPlayers()
local sd = CreateSound(game.GetWorld(), sdFile, filter)
sd:SetSoundLevel(0)
sd:Play()
end
end)

View File

@@ -0,0 +1,124 @@
--[[
| 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/
--]]
if (!file.Exists("autorun/vj_base_autorun.lua","LUA")) then return end
ENT.Base = "base_ai"
ENT.Type = "ai"
ENT.PrintName = "VJ Test NPC"
ENT.Author = "DrVrej"
ENT.Contact = "http://steamcommunity.com/groups/vrejgaming"
ENT.Purpose = "Just a testing NPC."
ENT.Instructions = "Don't change anything."
ENT.Category = "VJ Base"
ENT.Spawnable = false
ENT.AdminOnly = false
ENT.AutomaticFrameAdvance = true
function ENT:SetAutomaticFrameAdvance(bUsingAnim)
self.AutomaticFrameAdvance = bUsingAnim
end
if CLIENT then
function ENT:Draw() self:DrawModel() end
net.Receive("vj_testentity_onmenuopen", function()
local welMsgs = {
"Welcome to my shop, how can I help you?",
"Hi!",
"Hello "..LocalPlayer():GetName()..", You need anything?",
"What can I do for you "..LocalPlayer():GetName().."?",
"This ain't cheap stuff, but it is good!",
}
local frame = vgui.Create("DFrame")
frame:SetSize(600, 300)
frame:SetPos(ScrW()*0.5, ScrH()*0.5)
frame:SetTitle('VJ Test Menu')
//frame:SetBackgroundBlur(true)
frame:SetSizable(true)
frame:SetDeleteOnClose(false)
frame:MakePopup()
local label_wel = vgui.Create("DLabel", frame)
label_wel:SetPos(10, 30)
label_wel:SetText(VJ_PICK(welMsgs))
label_wel:SizeToContents()
local button_kill = vgui.Create("DButton", frame)
button_kill:SetText("Kill Yourself")
button_kill:SetPos(10, 50)
button_kill:SetSize(100, 50)
button_kill.DoClick = function()
RunConsoleCommand("kill")
LocalPlayer():EmitSound(Sound("vj_misc/illuminati_confirmed.mp3"), 0, 200)
end
local label_admin = vgui.Create("DLabel", frame)
label_admin:SetPos(10, 110)
label_admin:SetText("NOTE: Only admins can use these buttons! Most of this commands require 'sv_cheats' to be 1")
label_admin:SizeToContents()
local button_god = vgui.Create("DButton", frame)
button_god:SetText("Toggle God Mode")
button_god:SetPos(10, 130)
button_god:SetSize(100, 50)
button_god.DoClick = function()
if LocalPlayer():IsAdmin() then RunConsoleCommand("god") end
end
local button_buddha = vgui.Create("DButton", frame)
button_buddha:SetText("Toggle Buddha")
button_buddha:SetPos(120, 130)
button_buddha:SetSize(100, 50)
button_buddha.DoClick = function()
if LocalPlayer():IsAdmin() then RunConsoleCommand("buddha") end
end
local button_fp = vgui.Create("DButton", frame)
button_fp:SetText("Firstperson")
button_fp:SetPos(230, 130)
button_fp:SetSize(100, 50)
button_fp.DoClick = function()
if LocalPlayer():IsAdmin() then RunConsoleCommand("firstperson") end
end
local button_tp = vgui.Create("DButton", frame)
button_tp:SetText("Thirdperson")
button_tp:SetPos(340, 130)
button_tp:SetSize(100, 50)
button_tp.DoClick = function()
if LocalPlayer():IsAdmin() then RunConsoleCommand("thirdperson") end
end
if LocalPlayer():SteamID() == "STEAM_0:0:22688298" then
local button_vj = vgui.Create("DButton", frame)
button_vj:SetText("Illuminati")
button_vj:SetPos(10, 170)
button_vj:SetSize(50, 30)
button_vj.DoClick = function()
net.Start("vj_testentity_runtextsd")
net.WriteBool(false)
net.SendToServer()
end
local button_sd = vgui.Create("DButton", frame)
button_sd:SetText("THIRSTY")
button_sd:SetPos(120, 170 )
button_sd:SetSize(50, 30)
button_sd.DoClick = function()
net.Start("vj_testentity_runtextsd")
net.WriteBool(true)
net.SendToServer()
end
end
end)
end