Closed d-kuen closed 10 years ago
I don't know how you're thinking about it but I would appreciate that very much.
Do you prefer that I make a pullrequest or not?
Well technically you could do this
local old = AdvDupe.OverTimePasteStart
function AdvDupe.OverTimePasteStart( ... )
-- stuff
old( ... )
end
and the same for AdvDupe.Paste
Hmm, as I said in my first comment, replacing functions didn't work very well, but I will try it again. Thanks!
@Domii894 a pull request adding a hook would be ideal :)
@AbigailBuccaneer Ok, I will do ^^
Ok, after some testing I came to that point:
Adding a hook when a player began to paste a dupe is easy, because I can get the player from the arguments.
Adding a hook when a player finished to paste a dupe is a bit harder, because I don't get the player from the arguments or from somewhere else. Anyway I got the player out with:
TimedPasteData[1].Player
But in my opinion this is a bad way to get the player. Do you have a better idea for me?
the finished pasting hook already exists, 2 lines below the line you linked. did you not see it? https://github.com/wiremod/advduplicator/blob/master/lua/autorun/server/advdupe.lua#L2379
Yes I noticed this hook, but it doesn't contain the player who pasted the dupe, right? Or how can I get him?
this is how to get the player https://github.com/wiremod/advduplicator/blob/master/lua/autorun/server/advdupe.lua#L2385
Oh ok, thank you very much! I will make a pullrequest soon
I just made a pull request. I hope that I did a good job with it and also hope that I can use it soon ;)
Thank you guys for helping me!
Here is the link to the pull request: https://github.com/wiremod/advduplicator/pull/58
First I want to say thank you again for merging the pull request.
But may I can annoy you for one last time?
Will you update the workshop version too? I saw that the last update was on 18.8.2013, so there are also some other commits (4) which can be patched to the workshop version. Also I can be sure, that everyone has the current version and is able to use this new hook.
somebody administrate-y needs to do that, I don't think it's automatically built from a workshop
branch. @FaronFox @Anticept who is in charge of this, I can never remember
oh wait there is a workshop
branch so presumably it is auto-built from that. #60
Ok thank you again for your help!
Hey guys!
I searched for a way how to change a variable when a player is pasting a dupe. I looked into the code and searched for hooks or tried to replace functions and then the old function again, but nothing of that really worked. Also I don't like to replace existing functions.
I saw that there is already a hook when a player pasted a dupe, but not if a player started to paste one.
It would be awesome if you can add a little hook after the left-click to paste a dupe or whereever you want to run it.
Thank you!