Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 4 of 4
  1. #1
    Scout

    Join Date
    Feb 2009
    Posts
    3
    Post Thanks / Like
    Rep Power
    16
    Reputation
    15

    Exclamation [LuaHypArc] Lottery


    Register to remove this ad
    Code:
               --[ DEFINE_VARIABLES ]--
               local INITIATE_MSG = "#lotterystart"
               local ENTER_MSG = "#enter"
               local END_MSG = "#lotteryend"
     
    --[[ 
        REGISTER_ON_CHAT 
        ]]--
     
    function OnChat(event, pPlayer, message, type, language)
     lottery = 0
            --[ INTIATE_LOTTERY ]--
     if (message == INITIATE_MSG) and (pPlayer:IsGm() == true) then
      pPlayer:SendBroadcastMessage("Lottery has been initialized. Type #enter to enter into the lottery.")
      lottery = 1
      plrnumber = 0
            else
                    pPlayer:SendAreaTriggerMessage("You cannot start the lottery")
                    lottery = 0 
    end
     
           --[ ENTER_ LOTTERY ]--
     if (message == ENTER_MSG) then
      if (pPlayer:GetItemCount(80010) < 1) then
       pPlayer:SendAreaTriggerMessage("You don't have enough Coins to bet!")
            else
       pPlayer:RemoveItem(80010, 1)
       pPlayer:SendAreaTriggerMessage("Please wait until the Lottery has finished collecting.\n Your coin has been taken. Thank you!")
       plrnumber = plrnumber + 1
       CharDBQuery("INSERT INTO lottery (plrnumber, playername, win) VALUES ('"..plrnumber.."', '"..pPlayer:GetName().."', 0)", 0)
      end
     end
             --[ END_LOTTERY ]--
        if (message == END_MSG) then
      local pid = math.random(1, plrnumber)
      CharDBQuery("UPDATE `lottery` Set `win` = 1 Where `plrnumber` = '"..pid.."'", 0)
      lottery = 0
      plrnumber = 0
     end
    end
     
    --[[
        REGISTER_SERVER_HOOK
        ]]--
     
    RegisterServerHook(16, "OnChat")





    › See More: [LuaHypArc] Lottery



  2. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

  3. #2
    Elite Member
    Dimman's Avatar
    Join Date
    Apr 2009
    Posts
    1,091
    Post Thanks / Like
    Rep Power
    21
    Reputation
    319
    Information ?

    Credits ?



    Anyway Thanks for releasing
    No touching please.

  4. #3
    Contributor
    enegue's Avatar
    Join Date
    Aug 2008
    Location
    Before God
    Posts
    715
    Post Thanks / Like
    Rep Power
    18
    Reputation
    106
    I think it's basically the same thing Knaur has in his repack.
    me if I have helped you in anyway ^^ Example: Sharing a repack, answering questions... Well you know the rest xD. As long as I help you!

  5. #4
    Elite Member
    Dimman's Avatar
    Join Date
    Apr 2009
    Posts
    1,091
    Post Thanks / Like
    Rep Power
    21
    Reputation
    319

    Register to remove this ad
    Quote Originally Posted by enegue View Post
    I think it's basically the same thing Knaur has in his repack.
    Okey ?


    lol
    No touching please.

 

 

Visitors found this page by searching for:

luahyparc chardbquery

LuaHypArc

SEO Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 12:02 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org