Lottery

Moved

Total Downloads: 1,456 - First Release: Sep 21, 2016 - Last Update: Jul 25, 2018

5/5, 12 likes
  1. sami37 updated Lottery with a new update entry:

    1.1.6

     
  2. (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)
     
  3. Can you provide you config file please and tell me if you use HumanNPC/Economics/ServerRewards
     
  4. 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:

  5. sami37 updated Lottery with a new update entry:

    1.1.7

     
  6. 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.
    upload_2017-5-25_22-46-41.png
     
  7. Jackpot number reads different than 1111
     
  8. You are missing how this plugin should work. 1058 is to win the jackpot. jackpot payout works. The other matches dont give a payout.
    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
     
  9. 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
     
  10. Can you post your config file pls?
     
  11. i have downsized the max/min range numbers so they have a better chance of getting the prize
     

    Attached Files:

  12. Your JackpotMatch can't be under 1000, same for your range
    Your range number must be minimum 1000
     
  13. aah okayy so ill have to do it like 1000-1200 or something like that?
     
  14. yeah that it
     
  15. 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
     
  16. Hello,

    can you post a picture of the ingame UI ?
     
  17. just took a screenshot
     

    Attached Files:

  18. What other plugin you've installed between Economics and ServerRewards?
     
  19. sami37 updated Lottery with a new update entry:

    1.1.8

     
  20. @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.