Exactly.
Referencing another plugin?
Discussion in 'Rust Development' started by Nathan 3, Dec 12, 2016.
-
Code:private Dictionary<BasePlayer,int> gatherTracking= new Dictionary<BasePlayer,int>();
-
-
I thoughtCode:double money = (double)Economics?.CallHook("GetPlayerMoney", entity.ToPlayer().userID);
-
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. -
-
Declare is outside the hook, that's why I put it separate in my example code