Likes: 0
Results 1 to 4 of 4
Thread: [LuaHypArc] Lottery
-
30-10-09, 01:11 PM #1
[LuaHypArc] Lottery
Register to remove this adCode:--[ 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
-
30-10-09, 01:48 PM #2
Information ?
Credits ?
Anyway Thanks for releasingNo touching please.
-
08-11-09, 09:01 AM #3
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!
-
08-11-09, 09:21 AM #4
Register to remove this adNo touching please.