Hello, Cloud sixteen's community, I'm a part of a dev team for another hl2rp server and I've been trying to add a command allowing players to edit someone's data without opening the panel.This is the result:
Code:
local PLUGIN = PLUGIN;
local Clockwork = Clockwork;
local COMMAND = Clockwork.command:New("addPoints");
COMMAND.tip = "Voir la data d'une personne donné.";
COMMAND.text = "<Nom|CID>";
COMMAND.flags = CMD_DEFAULT;
COMMAND.arguments = 2;
-- Called when the command has been run.
function COMMAND:OnRun(player, arguments)
local target = Clockwork.player:FindByID(arguments[1]);
local targetdataPoints=arguments[2];
newTable={
rsn="test",
usr="system",
loy="Crédit de stérilisation",
num=tonumber(targetdataPoints)
};
target:SetCharacterData("combinepoints",newTable);
end;
COMMAND:Register();
But it does not work, I don't know why when I check the data with /viewdata I have this error.
Code:
[ERROR] gamemodes/cwhl2rp/plugins/betterviewdata/plugin/derma/cl_data.lua:248: attempt to index a string value with bad key ('rsn' is not part of the string library)
1. error - [C]:-1
2. __index - lua/includes/extensions/string.lua:297
3. PopulateRecords - gamemodes/cwhl2rp/plugins/betterviewdata/plugin/derma/cl_data.lua:248
4. Populate - gamemodes/cwhl2rp/plugins/betterviewdata/plugin/derma/cl_data.lua:148
5. unknown - gamemodes/cwhl2rp/plugins/betterviewdata/plugin/cl_plugin.lua:12
6. func - gamemodes/clockwork/framework/libraries/sh_datastream.lua:186
7. unknown - lua/includes/extensions/net.lua:32