mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
69
gamemodes/darkrp/plugins/writing/items/base/sh_plotters.lua
Normal file
69
gamemodes/darkrp/plugins/writing/items/base/sh_plotters.lua
Normal file
@@ -0,0 +1,69 @@
|
||||
--[[
|
||||
| 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
|
||||
|
||||
ITEM.name = "Newspaper Printer Base"
|
||||
ITEM.model = "models/willardnetworks/plotter.mdl"
|
||||
ITEM.width = 2
|
||||
ITEM.height = 2
|
||||
ITEM.skin = 1
|
||||
ITEM.description = ""
|
||||
ITEM.category = "Imprimerie"
|
||||
ITEM.ent = ""
|
||||
|
||||
ITEM.functions.Place = {
|
||||
name = "Placer",
|
||||
OnRun = function(itemTable)
|
||||
local client = itemTable.player
|
||||
local entity = ents.Create(itemTable.ent)
|
||||
local trace = client:GetEyeTraceNoCursor()
|
||||
|
||||
if (trace.HitPos:Distance( client:GetShootPos() ) <= 192) and !client.CantPlace then
|
||||
entity:SetPos(trace.HitPos)
|
||||
entity:Spawn()
|
||||
entity:SetNWInt("owner", client:GetCharacter():GetID())
|
||||
|
||||
client.CantPlace = true
|
||||
|
||||
if itemTable:GetData("paper") then
|
||||
entity.paper = itemTable:GetData("paper")
|
||||
entity:SetPaper(entity.paper)
|
||||
end
|
||||
|
||||
if itemTable:GetData("ink") then
|
||||
entity.ink = itemTable:GetData("ink")
|
||||
entity:SetInk(entity.ink)
|
||||
end
|
||||
|
||||
if itemTable:GetData("registeredCID") then
|
||||
entity.registeredCID = itemTable:GetData("registeredCID")
|
||||
end
|
||||
|
||||
if (IsValid(entity)) then
|
||||
entity:SetAngles(Angle(0, client:EyeAngles().yaw + 180, 0))
|
||||
end
|
||||
|
||||
ix.saveEnts:SaveEntity(entity)
|
||||
|
||||
timer.Simple(3, function()
|
||||
if client then
|
||||
client.CantPlace = false
|
||||
end
|
||||
end)
|
||||
elseif client.CantPlace then
|
||||
client:NotifyLocalized("Vous ne pouvez pas placer ceci maintenant !")
|
||||
return false
|
||||
else
|
||||
client:NotifyLocalized("Vous ne pouvez pas placer ceci trop loin !")
|
||||
return false
|
||||
end
|
||||
end
|
||||
}
|
||||
57
gamemodes/darkrp/plugins/writing/items/base/sh_writing.lua
Normal file
57
gamemodes/darkrp/plugins/writing/items/base/sh_writing.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
|
||||
|
||||
ITEM.name = "Writing Base"
|
||||
ITEM.model = "models/error.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.identifier = "base"
|
||||
ITEM.description = ""
|
||||
ITEM.category = "Imprimerie"
|
||||
ITEM.bAllowMultiCharacterInteraction = true
|
||||
|
||||
function ITEM:GetName()
|
||||
local title = self:GetData("title")
|
||||
if title and title != "" then return title end
|
||||
|
||||
return self.name
|
||||
end
|
||||
|
||||
function ITEM:GetDescription()
|
||||
return "Un support pour écrire / lire."
|
||||
end
|
||||
|
||||
function ITEM:SetBodygroups(bodygroups)
|
||||
self:SetData("bodygroups", bodygroups)
|
||||
end
|
||||
|
||||
function ITEM:GetModelBodygroups()
|
||||
return self:GetData("bodygroups") or ""
|
||||
end
|
||||
|
||||
ITEM.functions.Write = {
|
||||
name = "Lire / Ecrire",
|
||||
tip = "Lire / Ecrire ceci.",
|
||||
icon = "icon16/text_align_center.png",
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
if !IsValid(client) then return false end
|
||||
|
||||
if (SERVER) then
|
||||
PLUGIN:OpenWriting(client, item)
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.name = "Imprimante crackée"
|
||||
ITEM.uniqueID = "newspaper_printer_cracked"
|
||||
ITEM.description = "Une imprimante crackée, permettant d'imprimer des journaux."
|
||||
ITEM.ent = "ix_crackedprinter"
|
||||
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.name = "Imprimante de journaux"
|
||||
ITEM.uniqueID = "newspaper_printer"
|
||||
ITEM.description = "Une imprimante qui permet d'imprimer les journaux de l'Union."
|
||||
ITEM.ent = "ix_newspaperprinter"
|
||||
19
gamemodes/darkrp/plugins/writing/items/sh_blackink.lua
Normal file
19
gamemodes/darkrp/plugins/writing/items/sh_blackink.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
--[[
|
||||
| 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
|
||||
|
||||
ITEM.name = "Encre noire"
|
||||
ITEM.uniqueID = "black_ink"
|
||||
ITEM.model = "models/gibs/metal_gib2.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.description = "Une cartouche d'encre noire."
|
||||
ITEM.category = "Imprimerie"
|
||||
81
gamemodes/darkrp/plugins/writing/items/sh_pin.lua
Normal file
81
gamemodes/darkrp/plugins/writing/items/sh_pin.lua
Normal file
@@ -0,0 +1,81 @@
|
||||
--[[
|
||||
| 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
|
||||
|
||||
ITEM.name = "Broche"
|
||||
ITEM.uniqueID = "pin"
|
||||
ITEM.model = "models/props_c17/TrapPropeller_Lever.mdl"
|
||||
ITEM.width = 1
|
||||
ITEM.height = 1
|
||||
ITEM.description = "Une broche pour attacher les papiers ou autres aux murs."
|
||||
ITEM.category = "Imprimerie"
|
||||
|
||||
function ITEM:MakeNail(nailedEnt, pos, ang, client)
|
||||
pos = nailedEnt:LocalToWorld( pos )
|
||||
nailedEnt:GetPhysicsObject():EnableMotion(false)
|
||||
|
||||
local nail = ents.Create( "gmod_nail" )
|
||||
nail:SetPos( pos )
|
||||
nail:SetAngles( ang )
|
||||
nail:SetParent( nailedEnt )
|
||||
|
||||
nail:Spawn()
|
||||
nail:Activate()
|
||||
|
||||
local item = ix.item.instances[nailedEnt.ixItemID]
|
||||
item:SetData("pin", true)
|
||||
item:SetData("owner", client:GetCharacter():GetID())
|
||||
nail.itemparentID = nailedEnt.ixItemID
|
||||
nail.itemparentPos = nailedEnt:GetPos()
|
||||
nail.itemparentAngs = nailedEnt:GetAngles()
|
||||
|
||||
ix.saveEnts:SaveEntity(nail)
|
||||
end
|
||||
|
||||
ITEM.functions.Pin = {
|
||||
name = "Accrocher",
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
|
||||
local trace = client:GetEyeTrace()
|
||||
|
||||
-- Bail if we hit world or a client
|
||||
if ( !trace.Entity:IsValid() or trace.Entity:IsPlayer() ) then return false end
|
||||
|
||||
if ( SERVER and !util.IsValidPhysicsObject( trace.Entity, trace.PhysicsBone ) ) then return false end
|
||||
|
||||
local tr = {}
|
||||
tr.start = trace.HitPos
|
||||
tr.endpos = trace.HitPos + (client:GetAimVector() * 16.0)
|
||||
tr.filter = { client, trace.Entity }
|
||||
local trTwo = util.TraceLine( tr )
|
||||
|
||||
if ( trTwo.Hit and !trTwo.Entity:IsPlayer() ) then
|
||||
if trace.Entity:GetClass() != "ix_item" then
|
||||
client:NotifyLocalized("Seulements les objets peuvent êtres collés !")
|
||||
return false
|
||||
end
|
||||
|
||||
-- Client can bail now
|
||||
if ( CLIENT ) then return true end
|
||||
|
||||
local vOrigin = trace.HitPos - (client:GetAimVector() * 8.0)
|
||||
local vDirection = client:GetAimVector():Angle()
|
||||
|
||||
vOrigin = trace.Entity:WorldToLocal( vOrigin )
|
||||
item:MakeNail( trace.Entity, vOrigin, vDirection, client )
|
||||
client:EmitSound("weapons/crossbow/hit1.wav", 110)
|
||||
else
|
||||
client:NotifyLocalized("Aucun objet à coller !")
|
||||
return false
|
||||
end
|
||||
end
|
||||
}
|
||||
15
gamemodes/darkrp/plugins/writing/items/writing/sh_book.lua
Normal file
15
gamemodes/darkrp/plugins/writing/items/writing/sh_book.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
|
||||
ITEM.name = "Livre"
|
||||
ITEM.model = "models/willardnetworks/misc/book.mdl"
|
||||
ITEM.identifier = "book"
|
||||
@@ -0,0 +1,22 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.name = "Journal"
|
||||
ITEM.model = "models/props_junk/garbage_newspaper001a.mdl"
|
||||
ITEM.identifier = "newspaper"
|
||||
|
||||
function ITEM:OnInstanced()
|
||||
if self.data and self.data.data then
|
||||
if self.data.data.writingID then self:SetData("writingID", self.data.data.writingID) end
|
||||
if self.data.data.title then self:SetData("title", self.data.data.title) end
|
||||
if self.data.data.cracked then self:SetData("cracked", self.data.data.cracked) end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
|
||||
ITEM.name = "Bloc-notes"
|
||||
ITEM.model = "models/willard/work/notepad1.mdl"
|
||||
ITEM.identifier = "notepad"
|
||||
34
gamemodes/darkrp/plugins/writing/items/writing/sh_paper.lua
Normal file
34
gamemodes/darkrp/plugins/writing/items/writing/sh_paper.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
--[[
|
||||
| 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/
|
||||
--]]
|
||||
|
||||
|
||||
ITEM.name = "Papier"
|
||||
ITEM.model = "models/props_c17/paper01.mdl"
|
||||
ITEM.identifier = "paper"
|
||||
|
||||
ITEM.functions.zTear = { -- I want it to be last
|
||||
name = "Déchirer",
|
||||
icon = "icon16/textfield_delete.png",
|
||||
OnRun = function(item)
|
||||
local client = item.player
|
||||
|
||||
client:RequestConfirmation("Déchirer", "Etes-vous sûrs de déchirer ce papier ?", function(confirmation)
|
||||
if (!confirmation) then return end
|
||||
|
||||
client:Notify("Vous avez déchiré le papier.")
|
||||
item:Remove()
|
||||
end)
|
||||
|
||||
return false
|
||||
end,
|
||||
OnCanRun = function(item)
|
||||
return !item.entity or !IsValid(item.entity)
|
||||
end
|
||||
}
|
||||
Reference in New Issue
Block a user