Raised This Month: $ Target: $400
 0% 

Bet


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
floatman
Senior Member
Join Date: Oct 2009
Location: nowhere.
Old 01-20-2010 , 06:35   Re: Bet v1.1
Reply With Quote #1

amxmodx and amxmisc aren't modules!
__________________

floatman is offline
kobatz
Junior Member
Join Date: Mar 2008
Old 01-20-2010 , 07:33   Re: Bet v1.1
Reply With Quote #2

Very nice,will test it ;) Tnx
kobatz is offline
rdrag
New Member
Join Date: Jan 2010
Old 01-20-2010 , 09:20   Re: Bet v1.1
Reply With Quote #3

Here is my russian translation:
Quote:
[ru]
TEAM_DEAD = Вы не можете делать ставки, когда вся команда мертва!
TEAM_DEAD_ODDS = Одна из команд мертва!
SAME_ODDS = Шансы: %d к %d.
DIFF_ODDS = Шансы %d к %d если вы сделаете ставку на террористов.
BET_HELP = Чтобы сделать ставку, напишите в чат ^"bet <команда> <кол-во денег>^".
NO_AMOUNT = Не задано кол-во денег. Напишите ^"bet^" для получения помощи.
INVALID_TEAM = Неверное название команды ^"%s^". Используйте "t" или "ct".
NO_MONEY = У вас не хватает денег!
INVALID_AMOUNT = Неверная сумма ^"%s^". Используйте "all", "half" или численное значение.
BIGGER_BET = У вас на счету $%d, поэтому вы не можете поставить $%d.
PLAYER_ALIVE = Вы можете делать ставки, когда мертвы!
ALREADY_PLACED = Вы уже сделали ставку!
BET_PLACED = Ставка сделана. Ваши шансы %d к %d. Вы выиграете $%d сверх вашей ставки $%d.
BET_WIN = Вы выиграли $%d.
BET_LOST = Вы проиграли $%d.

Last edited by rdrag; 01-20-2010 at 09:26. Reason: problems with codepage
rdrag is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 01-20-2010 , 10:15   Re: Bet v1.1
Reply With Quote #4

Nice. I need a good bet plugin in the near future. Will take a look at it later.

German:
Code:
[de]
TEAM_DEAD = Du kannst nicht setzen wenn eines der Teams bereits tot ist!
TEAM_DEAD_ODDS = Eines der Teams ist tot!
SAME_ODDS = Die Chancen stehen %d zu %d.
DIFF_ODDS = Die Chancen stehen %d zu %d wenn du auf die Terroristen setzt.
BET_HELP = Benutze ^"bet team amount^" um zu setzen. Beispiele: ^"bet t all^" oder ^"bet ct 250^" oder ^"bet t half^"
NO_AMOUNT = Betrag nicht angegeben. Bitte tippe ^"bet^" ein um die Hilfe aufzurufen.
INVALID_TEAM = Falscher Team Name ^"%s^". Bitte benutze t oder ct um ein Team zu wählen.
NO_MONEY = Du hast kein Geld um zu setzen!
INVALID_AMOUNT = Falscher Betrag ^"%s^". Bitte benutze all, half oder eine Zahl als Mengenangabe.
BIGGER_BET = Du hast %d$, du kannst keine %d$ setzen.
PLAYER_ALIVE = Du kannst nur setzen wenn du tot bist.
ALREADY_PLACED = Du hast bereits gesetzt.
BET_PLACED = Wetteinsatz gesetzt. Chancen stehen %d zu %d. Du kannst %d$ zusaetzlich zu deinem Einsatz von %d$ gewinnen.
BET_WIN = Du hast %d$ gewonnen.
BET_LOST = Du hast deinen Wetteinsatz von %d$ verloren.
/edit: Code suggestions
- compare_array -> equali. Why do you code an own implementation when you got equal(i). equali is in fact better because you don't force people to only write lowercase.
- Hook "say bet " instead of "say". You halt the function if the first word is not bet anyway.
- in function FindOdds you can do switch(cs_get_user_team(x)) directly. The team variable is not necessary.
- You are actually commenting which code blocks are closed at what point. This relates to the poor, or at least inconsistent, indentation. You should rethink that.
- You should check whether the user is alive directly after you know that he wants to place the bet. You did a lot of stuff that you don't need when you find out hes alive in the Bet function.
- In the Bet function you are again checking whether FindOdds returns 0. The functions will execute one after another without a delay, impossible that the situation changes between the two FindOdds calls.

There are probably more possibilities to improve.
__________________
In Flames we trust!

Last edited by Nextra; 01-20-2010 at 10:34.
Nextra is offline
vilaemail
Member
Join Date: Jan 2009
Location: Tu i tamo, svuda pomalo
Old 01-20-2010 , 13:53   Re: Bet v1.1
Reply With Quote #5

Quote:
Originally Posted by Nextra View Post
Nice. I need a good bet plugin in the near future. Code suggestions
- compare_array -> equali. Why do you code an own implementation when you got equal(i). equali is in fact better because you don't force people to only write lowercase.
- Hook "say bet " instead of "say". You halt the function if the first word is not bet anyway.
- in function FindOdds you can do switch(cs_get_user_team(x)) directly. The team variable is not necessary.
- You are actually commenting which code blocks are closed at what point. This relates to the poor, or at least inconsistent, indentation. You should rethink that.
- You should check whether the user is alive directly after you know that he wants to place the bet. You did a lot of stuff that you don't need when you find out hes alive in the Bet function.
- In the Bet function you are again checking whether FindOdds returns 0. The functions will execute one after another without a delay, impossible that the situation changes between the two FindOdds calls.

There are probably more possibilities to improve.
-will use equali, thanks.
-say bet can not be hooked. look here: http://forums.alliedmods.net/showthread.php?t=103434
-Team variable IS necessary because I am checking which team he placed bet on (not the team he is on!)
-OK
-OK
-Incorrect! I am checking FindOdds in sayBet only if user typed odds! But if he/she typed bet, findOdds will never be tested before the Bet function (if user typed odds the code will never enter Bet function). And I must test in Bet function because that's the only way to get the actual odds for betting!

Thanks for constructive comments, I hope for more of them in future.

Thank you all for translations!

Last edited by vilaemail; 01-20-2010 at 14:05.
vilaemail is offline
vilaemail
Member
Join Date: Jan 2009
Location: Tu i tamo, svuda pomalo
Old 01-22-2010 , 07:04   Re: Bet
Reply With Quote #6

Plugin is updated to v1.5a and I think all bugs are gone now. How to get plugin approved?
__________________
If you are putting me to credits of some kind please put "Filip Vilicic" instead of "vilaemail". Or put both. Thanks.
vilaemail is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 01-22-2010 , 07:49   Re: Bet
Reply With Quote #7

Wait for an AMXModX plugin approver to review your plugin. This can take some time depending on how busy these people are.
__________________
In Flames we trust!
Nextra is offline
vilaemail
Member
Join Date: Jan 2009
Location: Tu i tamo, svuda pomalo
Old 01-22-2010 , 13:55   Re: Bet
Reply With Quote #8

Quote:
Originally Posted by Nextra View Post
Wait for an AMXModX plugin approver to review your plugin. This can take some time depending on how busy these people are.
No problem, I have patience and understand them.. There are a lot of pending plugins
__________________
If you are putting me to credits of some kind please put "Filip Vilicic" instead of "vilaemail". Or put both. Thanks.
vilaemail is offline
n3x
Junior Member
Join Date: Oct 2009
Old 04-30-2010 , 11:59   Re: Bet
Reply With Quote #9

Please could one make a translation Portuguese Brazil
n3x is offline
s3rserii
Senior Member
Join Date: Jan 2010
Old 05-02-2010 , 07:37   Re: Bet
Reply With Quote #10

turkish

[tr]
TEAM_DEAD = Takimdan birisi oeldukten sonra bahse giremessin!
TEAM_DEAD_ODDS = Takimdan birisi kaybetti!
SAME_ODDS = Sansin %d = %d.
DIFF_ODDS = Terror takimini secersen sansin %d = %d.
BET_HELP = Bahse girmek icin ^"bet team amount^" yaz. Mesela: ^"bet t all^" yada ^"bet ct 250^" yada ^"bet t half^"
NO_AMOUNT = Para miktari secilmedi. Yardim almak icin luetfen ^"bet^" yazin.
INVALID_TEAM = Yanlis takim adi ^"%s^". Ya t yada ct yazmaniz gerek.
NO_MONEY = Bahse girmek icin paraniz kalmadi!
INVALID_AMOUNT = Yanlis miktar ^"%s^". Ya all yazin,yada half yada istediginiz bir miktari.
BIGGER_BET = Hesabinizda %d$ var, istediginiz miktarla bahse giremezsiniz: %d$.
PLAYER_ALIVE = Tek oelduense bahse girebilirsin.
ALREADY_PLACED = Zaten bahse girdin.
BET_PLACED = Bahse girildi. Sansin %d = %d. Kazanabilecegin miktar: %d$ bahse girdigin miktarin uzerine hesaplanacak %d$ gewinnen.
BET_WIN = %d$ para kazandin.
BET_LOST = Bahse girdigin miktari malesef kaybetin: %d$.

peace
s3rserii is offline
Reply



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 09:50.


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