Lottery

Moved

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

5/5, 12 likes
  1. Hello everyone,

    Thank you Sami37 for your plugin. it works fine on my server.

    But I'm trying to change the color of the 'wins' and 'lose' messages in the lottery.cs file, but since I'm not a developer, obviously I can not.
    Here is what I tried.

    string.Format(lang.GetMessage(color(#cc0000), "NoWin", this, arg.Player().UserIDString), random));

    An idea to reach my goal ?

    In addition, I notice that the player wins 2 out of 10.
    Is there a way to increase this ratio ?

    Thank you in advance for the help
     
  2. Hello, to change a color message you may edit directly the message from lang file like
    Code:
    "NoWin": "<color=red>You roll {0} </color><color=green>but don't win anything.</color>"
    About the ratio, the system is completelly based on Random class and use Random.Next() to generate a value between the min and max from the config file.
    So i guess if you want to give more chance to your player, you may reduce this interval, by default it's 1000 ~ 9999, by reducing the interval you increase the chance. But you can also add more roll match to the list that will also increase the chance of winning something.
     
  3. Thank you very much Sami.
     
  4. Sami,

    The plugin works. I do not see any problem in game.
    But yet I have these errors on the server when a player plays the lottery.

    bug.jpg

    What do you think ?
     
  5. Here is the isolated message when a player place bet

    Code:
    Failed to call hook 'cmdPlaceBet' on plugin 'Lottery v1.2.1' (NullReferenceException: Object reference not set to an instance of an object)
      at Oxide.Plugins.Lottery.ShowSrLotery (BasePlayer player, System.String[] args) [0x00000] in <2faa1ec6d900482593984c0d66ded9e4>:0
      at Oxide.Plugins.Lottery.cmdPlaceBet (ConsoleSystem+Arg arg) [0x009ba] in <2faa1ec6d900482593984c0d66ded9e4>:0
      at Oxide.Plugins.Lottery.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00564] in <2faa1ec6d900482593984c0d66ded9e4>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <4de2a9f5b1eb4f0ea3c4c9778603446d>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <bfa4e457157d4e089ab91719c5b1288b>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <bfa4e457157d4e089ab91719c5b1288b>:0
    Yet I do not see any problem of gain in the game


    UPDATE : in my config: ''Place Bet Auto-close": true,
     
    Last edited by a moderator: Jul 22, 2018
  6. sami37 updated Lottery with a new update entry:

    1.2.2

     
  7. Thank you Samy.
    The errors messages have disappeared

    But another problem appears.
    If the player bets too much, he can not reset.

    And if he comes out of the Lottery game, and come back his bet stays the same on his return.
    No reset

    bug2.jpg
     
  8. Thanks for the feedback, i'll add a reset button
     
  9. sami37 updated Lottery with a new update entry:

    1.2.3

     
  10. Thanks Sami

    We are almost there ;-)
    The reset button works. But then the message 'Server Rewards isn't installed' is displayed.
    I only use Economics.
     
  11. sami37 updated Lottery with a new update entry:

    1.2.4

     
  12. same problem

    bug3.jpg
     
  13. sami37 updated Lottery with a new update entry:

    1.2.5

     
  14. one word : Perfect
     
  15. i have no idea how to give myself permission to use this i am the owner of my server