Getting data from one addon and get in tranfered over to another.
4 replies, posted
Basically, i wanna transfer data from one file(Addon) to another file.
So when a player collects money on a money printer I want to transfer data.
[U]BUT[/U] both files are server sided that is very important!
[IMG]https://s11.postimg.org/qq1olzy6r/Udklip.jpg[/IMG]
Let's say we take the money printer snippet of code here.
[LUA]
function ENT:Use(activator)
-- Logs that money has been claimed
-- Claims money here
end
[/LUA]
So what little bit of code is needed where it says "Logs that money has been claimed
" to actually send the data to another addon.
It's just an entity that looks like a computer, and all I need is to send a string to another file, so that an NPC can show you what has been bought on the computer.
[editline]13th February 2017[/editline]
[QUOTE=Rocket;51815898]It entirely depends on the details of each addon.[/QUOTE]
28 Posts
It's just an entity that looks like a computer, and all I need is to send a string to another file, so that an NPC can show you what has been bought on the computer.
[QUOTE=thejjokerr;51815966]Just make a function in the logging addon and call it from the computer addon.
Logging addon:
[lua]log = {};
function log.Add(message)
print(message); // do whatever you want to log it here
end;[/lua]
Computer addon:
[lua]function ENT:Use(activator)
-- Logs that money has been claimed
if(log and log.Add)then
log.Add("Money has been claimed by " .. activator:Nick());
end;
-- Claims money here
end;[/lua]
Or something similar.[/QUOTE]
Thanks!
Sorry, you need to Log In to post a reply to this thread.