Files
wnsrc/gamemodes/darkrp/plugins/combineutilities/items/sh_floppydisk.lua
lifestorm df294d03aa Upload
2024-08-04 23:54:45 +03:00

69 lines
1.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

--[[
| 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 = "Disk"
ITEM.model = "models/props/cs_office/computer_caseb_p9a.mdl"
ITEM.skin = 1
ITEM.width = 1
ITEM.height = 1
ITEM.description = "Bilgi yüklemesi için kullanılan, manyetik bir depolamanın ince ve esnek bir diskinden oluşan disk depolama."
ITEM.category = "Computers"
function ITEM:GetName()
if self:GetData("customName", false) then
return self:GetData("customName", false)
end
return self.name
end
ITEM.functions.Place = {
name = "Insert Into Computer",
tip = "equipTip",
icon = "icon16/link_add.png",
OnRun = function(itemTable)
if (SERVER) then
local client = itemTable.player
PLUGIN:InsertDisk(client, itemTable)
return false
end
end,
OnCanRun = function(itemTable)
if IsValid(itemTable.entity) then return false end
end
}
function ITEM:OnTransferred(curInv, inventory)
if (SERVER) then
if self.computer and IsValid(self.computer) then
self.computer.hasDiskInserted = nil
end
end
end
ITEM.functions.Name = {
name = "Name Disk",
tip = "equipTip",
icon = "icon16/link_add.png",
OnRun = function(itemTable)
if (SERVER) then
local client = itemTable.player
if !client then return end
netstream.Start(client, "SetFloppyDiskName", itemTable:GetData("customName", false), itemTable.id, itemTable:GetData("password", false))
end
return false
end
}