Raised This Month: $94 Target: $400
 23% 

Subplugin Submission [ZP] Addon: Lottery v2.3


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Fun Stuff        Approver:   Hawk552 (427)
Kiske
Veteran Member
Join Date: May 2009
Old 08-22-2009 , 01:56   [ZP] Addon: Lottery v2.3
Reply With Quote #1

[ZP] Addon: Lottery v2.3
By Kiske

--| Description |--
This lottery had 2 modes of games (define by CVAR)
Default: 0
0: Each player can bet a number between 0 and 200 (define by CVAR), at the end of the round, a number between 0 and 200 (define by CVAR) will be showed, if somebody played that number, and HUD message will be sent to everybody announcing that "X" person won, that person will recieve 200 AmmoPacks (define by CVAR).
If nobody played that number, an HUD message will be sent to everybody announcing that nobody won.


1: Each player can bet AmmoPacks, and a number between 0 and 200 (define by CVAR), at the end of the round, a number between 0 and 200 (define by CVAR) will be showed, if somebody played that number, and HUD message will be sent to everybody announcing that "X" person won, that person will recieve AmmoPacks Bet x3 (define by CVAR).
If nobody played that number, an HUD message will be sent to everybody announcing that nobody won.

Important: One Person Online = Plugin Disabled
Only it works with 2 or more Online Players.


--| CVARS |--
PHP Code:
cvar_number_max 200 // Max number to bet
cvar_reward_ammos_for_win // Ammo packs you will win if you are right
zp_lot_ammopacks_bet_on 0 // Mode Game -- Default 0
zp_lot_multiplier_ammos_for_win 3.0 // AmmoPacks you will win if you are right 
--| Modules and Includes Required |--
Quote:
  • amxmodx
  • zombieplague

--| Changelog |--
Quote:
  • v1.0: Plugin Release.
  • v1.1: Add Already Bet.
  • v1.2: Add Number Bet.
  • v1.4: Add CVARS.
  • v1.5: Add Message.
  • v1.7: Add Stock.
  • v1.9: Add ML Support.
  • v2.0: Add Two Mode Games.
  • v2.3: Bug Fix! -- When One Online Player = Plugin Bug, now is Plugin Disabled.

--| Multilingual |--
Quote:
  • [EN] After
  • [ES] Kiske
  • [PL] MmikiM
  • [NL] crazyeffect
  • [DE] D o o m
  • [LV] NiHiLaNTh
  • [RU] NiHiLaNTh
  • [RO] dorin2oo7
  • [LT] hleV
Multilingual Thread: http://forums.alliedmods.net/showthread.php?t=101236

--| Thanks To |--
Quote:
  • meTaLiCroSS
  • Starsailor

--| ScreenShots |--

--| Download |--
Attached Files
File Type: sma Get Plugin or Get Source (zp_lott.sma - 4029 views - 5.8 KB)
File Type: zip zp_lottery.zip (4.7 KB, 2531 views)
__________________


Last edited by Kiske; 09-08-2009 at 18:56. Reason: Update ML!
Kiske is offline
Send a message via Skype™ to Kiske
Gaston
Senior Member
Join Date: Jun 2009
Location: En La Compu
Old 08-22-2009 , 01:58   Re: [ZP] Addon: Lottery v1.9
Reply With Quote #2

thanks kiske
__________________
Dragon Force Of Heart
Valley OF The Damned is the recommend
Gaston is offline
Starsailor
horrible hahah
Join Date: Aug 2008
Location: Buenos Aires
Old 08-22-2009 , 02:10   Re: [ZP] Addon: Lottery v1.9
Reply With Quote #3

PHP Code:
if(g_loteria_usernum[id] == g_loteria_num)
        {
            new 
name[32]; get_user_name(idnamecharsmax(name))
            
set_hudmessage(0255255, -1.00.4010.05.05.01.0, -1)
            
show_hudmessage(0"%L"LANG_SERVER"WIN_PLAYER"g_loteria_numnameget_pcvar_num(cvar_reward_ammos_for_win))
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + get_pcvar_num(cvar_reward_ammos_for_win))
        }
        else
        {
            
set_hudmessage(0255255, -1.00.4010.05.05.01.0, -1)
            
show_hudmessage(id"%L"LANG_SERVER"ALL_LOSERS"g_loteria_num)
        } 
Should be

PHP Code:
if(g_loteria_usernum[id] == g_loteria_num)
        {
            new 
name[32]; get_user_name(idnamecharsmax(name))
            
set_hudmessage(0255255, -1.00.4010.05.05.01.0, -1)
            
show_hudmessage(id"%L"id"WIN_PLAYER"g_loteria_numnameget_pcvar_num(cvar_reward_ammos_for_win))
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + get_pcvar_num(cvar_reward_ammos_for_win))
        }
        else
        {
            
set_hudmessage(id255255, -1.00.4010.05.05.01.0, -1)
            
show_hudmessage(id"%L"id"ALL_LOSERS"g_loteria_num)
        } 
if you dont change this you are showing the hud 32 times to all players

And change this
Modification: Counter-Strike
Category: Fun Stuff
__________________
Find my plugins here..

Ex - Spanish Moderator.

Last edited by Starsailor; 08-22-2009 at 02:15.
Starsailor is offline
Kiske
Veteran Member
Join Date: May 2009
Old 08-22-2009 , 02:18   Re: [ZP] Addon: Lottery v1.9
Reply With Quote #4

Quote:
Originally Posted by Starsailor View Post
PHP Code:
if(g_loteria_usernum[id] == g_loteria_num)
        {
            new 
name[32]; get_user_name(idnamecharsmax(name))
            
set_hudmessage(0255255, -1.00.4010.05.05.01.0, -1)
            
show_hudmessage(0"%L"LANG_SERVER"WIN_PLAYER"g_loteria_numnameget_pcvar_num(cvar_reward_ammos_for_win))
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + get_pcvar_num(cvar_reward_ammos_for_win))
        }
        else
        {
            
set_hudmessage(0255255, -1.00.4010.05.05.01.0, -1)
            
show_hudmessage(id"%L"LANG_SERVER"ALL_LOSERS"g_loteria_num)
        } 
Should be

PHP Code:
if(g_loteria_usernum[id] == g_loteria_num)
        {
            new 
name[32]; get_user_name(idnamecharsmax(name))
            
set_hudmessage(0255255, -1.00.4010.05.05.01.0, -1)
            
show_hudmessage(id"%L"id"WIN_PLAYER"g_loteria_numnameget_pcvar_num(cvar_reward_ammos_for_win))
            
zp_set_user_ammo_packs(idzp_get_user_ammo_packs(id) + get_pcvar_num(cvar_reward_ammos_for_win))
        }
        else
        {
            
set_hudmessage(id255255, -1.00.4010.05.05.01.0, -1)
            
show_hudmessage(id"%L"id"ALL_LOSERS"g_loteria_num)
        } 
if you dont change this you are showing the hud 32 times to all players

And change this
Modification: Counter-Strike
Category: Fun Stuff

Oh yes yes, ^^
already update.

Edit: Thx stars, updated ;)
__________________

Kiske is offline
Send a message via Skype™ to Kiske
AfteR.
Veteran Member
Join Date: Dec 2008
Location: λ
Old 08-22-2009 , 13:45   Re: [ZP] Addon: Lottery v2.0
Reply With Quote #5

Nice
AfteR. is offline
juancitoPlugins
BANNED
Join Date: Jul 2009
Old 08-22-2009 , 20:02   Re: [ZP] Addon: Lottery v2.0
Reply With Quote #6

excelent!
juancitoPlugins is offline
Artenis
Member
Join Date: Mar 2008
Old 08-23-2009 , 05:13   Re: [ZP] Addon: Lottery v2.0
Reply With Quote #7

Only used mode 0 but if one person gets it right everyone gets aps.
Artenis is offline
Kiske
Veteran Member
Join Date: May 2009
Old 08-23-2009 , 12:39   Re: [ZP] Addon: Lottery v2.0
Reply With Quote #8

Quote:
Originally Posted by Artenis View Post
Only used mode 0 but if one person gets it right everyone gets aps.


EDIT:
Bug Fix !
Thanks for warning.
__________________


Last edited by Kiske; 08-23-2009 at 15:56.
Kiske is offline
Send a message via Skype™ to Kiske
tempito
Senior Member
Join Date: Feb 2009
Location: Peru
Old 08-23-2009 , 20:59   Re: [ZP] Addon: Lottery v2.3
Reply With Quote #9

What can happen if 2 persons choose the same number?
__________________
My very first zp server movie.
http://www.youtube.com/watch?v=yvTmlFr_Y-4 <- now with translation in english

tempito is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 08-23-2009 , 21:02   Re: [ZP] Addon: Lottery v2.3
Reply With Quote #10

Quote:
Originally Posted by tempito View Post
What can happen if 2 persons choose the same number?
The 2 Wins (i think)
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:07.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode