sami37 updated Lottery with a new update entry:
1.1.6
Lottery
Moved
Total Downloads: 1,456 - First Release: Sep 21, 2016 - Last Update: Jul 25, 2018
- 5/5, 12 likes
-
(23:31:55) | Failed to call hook 'OnUseNPC' on plugin 'Lottery v1.1.6' (NullReferenceException: Object reference not set to an instance of an object)
And if not using npc on pressing +1 or any number:
Failed to call hook 'cmdBet' on plugin 'Lottery v1.1.6' (NullReferenceException: Object reference not set to an instance of an object) -
-
I am using human npc with serverrewards (NPc is set to false as I got the first error with it set to true)
Attached Files:
-
-
-
I believe the jackpot works, but I've never been able to get payout for any of the other matches.
Here's an example.. i set the min range to 1110 and the max range to 1112. I roll 1111 exactly, and still don't win.
-
Jackpot number reads different than 1111
-
See the overview
Economics :
111x is the number rolled by player where "x" mean a random number and the "1" after the double dot is the percent of win rate.
Example if a player place bet 100 with multiplicator 4 and roll a 1111 he will win 100*(1/100)*4 -
hey could you help me out? im getting this error....
at Oxide.Plugins.Lottery.FindReward (.BasePlayer player, Int32 bet, Int32 reference, Int32 multiplicator) [0x00000] in <filename unknown>:0
at Oxide.Plugins.Lottery.cmdPlaceBet (.Arg arg) [0x00000] in <filename unknown>:0
at Oxide.Plugins.Lottery.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0 -
-
i have downsized the max/min range numbers so they have a better chance of getting the prize
Attached Files:
-
-
Your JackpotMatch can't be under 1000, same for your range
Your range number must be minimum 1000 -
aah okayy so ill have to do it like 1000-1200 or something like that?
-
-
Install for first time today and im getting this error when I type /lot. The gui is off the right side of the screen. I just see a little part of the black screen.
Code:Failed to call hook 'cmdLotery' on plugin 'Lottery v1.1.7' (NullReferenceException: Object reference not set to an instance of an object) (14:03:17) | at Oxide.Plugins.Lottery.ShowLotery (.BasePlayer player, System.String[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Lottery.cmdLotery (.BasePlayer player, System.String command, System.String[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Lottery.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in <filename unknown>:0
-
can you post a picture of the ingame UI ? -
just took a screenshot
Attached Files:
-
-
-
-
@sami37 please read for fix
The jackpot works but the other rewards do not when using Economics. I have no idea about Server Rewards. I did some debugging and figured out that FindReward function will always return 0 for reward no matter what. I manually set the reference variable to some values that should give a winning result, and still 0. In debugging I was able to tell that all your key lookups and everything were working OK. The issue came down to this line:
reward = bet*(Convert.ToInt32(rws)/100) * multiplicator;
no matter what, (Convert.ToInt32(rws) / 100) = 0
so reward = bet * 0 * multiplicator = 0
You can probably figure out a better fix.. I am newb with this but to fix this is what I did:
Find all
reward = bet*(Convert.ToInt32(rws)/100) * multiplicator;
and replace with
reward = bet * Convert.ToInt32(rws) * multiplicator;
THEN
Find
rwd = (int) reward;
and replace with
rwd = (int) reward / 100;
Please note, I didn't look at ServerRewards at all.. only Economics.