1. Exactly.
     
  2. Ahhh nice! How come Wekrat said I would need
    Code:
    private Dictionary<BasePlayer,int> gatherTracking= new Dictionary<BasePlayer,int>();
    to prevent multiple users getting the message so if I gathered twice and someone else once we would both get the message, If the server is single-threaded like you said surely that would not be needed or maybe i'm misunderstanding the mechanics?
     
  3. I didn't read all of the past posts, but from what I can see, this is to keep it triggering every 3 times for a specific player, not 3 times when any person hits it. (e.g. one player hits it twice, a second player hits it once and gets it)
     
  4. I still don't see how that would stop it, I just see the tracker being used for the counter part which is just informational text?

    I thought
    Code:
    double money = (double)Economics?.CallHook("GetPlayerMoney", entity.ToPlayer().userID);
    would give the money to the entity.ToPlayer().userID which VVoid said the way the server works the hook is not shared so the person gathering resources would get the money and not the other player that hits once?
     
  5. The hook is called every time someone gathers. Assuming counter is global in your original code, it would count every time anyone gathers, then trigger on the 3rd call. If counter isn't defined anywhere, the code will just be broken and not work at all.

    What I did was create individual tracking for each player who gathers, check it and increment it with each gather for THAT player, so it achieves what you were going for. It's global so the dictionary is able to keep track.
     
  6. Ahhh that makes sense, So just assigning counter in OnGatherDispenser makes it become global? I am learning scope at the minute so I will come back to this thread and it will make more sense.
     
  7. Declare is outside the hook, that's why I put it separate in my example code ;)