0

我正在使用框架 Clockwork HL2RP 并努力创建一个项目,该项目表示为一个对象:

>local ITEM = Clockwork.item:New();

>ITEM.name = "Citizen CID";

>ITEM.cost = 1;

>ITEM.model = "models/dorado/tarjetazero.mdl";

>ITEM.weight = 0;

>ITEM.access = "v";

>ITEM.useText = "Print Info";
>ITEM.description = "A small, plastic card with a blank side.";

...等等。每个包含任何数据的项目都会ITEM.useText自动插入一个“使用”按钮,激活 OnUse 功能。

ITEM:AddData("description", "A small, plastic card with a blank side.", true);
ITEM:AddQueryProxy("description", "description");
ITEM:AddData("useText", "Print Info", true);
ITEM:AddQueryProxy("useText", "useText");

function ITEM:OnUse(player, itemEntity)
local citizenCID = player:GetSharedVar("citizenID");
local citizenName = player:Name();
self:removeData("useText", “Print Info”);
self:SetData("description", "Name: "..citizenName.."\nCID: "..citizenCID.."\n\nA Citizen Identification Card filled with information.");
return false;
end;

这就是我到目前为止所拥有的。但是,我希望“useButton”在打印用户信息后消失。我该怎么做?

4

0 回答 0