[XAseco] Betting Plugin v0.3.5 - WITH MANIALINKS for betting

Discuss everything about Xymph's Aseco flavoured server control scripts for TM Forever / classic TMN and for TM² Canyon.

Moderators: Xymph, TM-Patrol

Post Reply
vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

[XAseco] Betting Plugin v0.3.5 - WITH MANIALINKS for betting

Post by vineeth.h » 29 Jul 2009 18:26

Read through my entire post before asking questions which might have already been answered .

DOWNLOAD THE PLUGIN :

http://www.hotlinkfiles.com/files/23491 ... lugins.rar
Screenshots.
Betting Panel
http://img190.imageshack.us/i/betpanel.jpg/
Accepting Panel
http://img23.imageshack.us/i/acceptn.jpg/
Finish Payout Panel
http://img198.imageshack.us/i/finishz.jpg/

Update v0.3.5
Major Upgrades from the previous version to the new version:

1. Up until the last version Betters/Acceptors had to finish 1st on each track to win the bet.
Now i've upgraded it so that you can finish at any position above the other acceptors to win the bet. :3

The thing about this upgrade is ,as you might have guessed,the server mostly won't make any profit!Since one of the betters/acceptors just has to finish the map once to win the bet!

If you prefer the older version where you have to finish 1st to win the bet,then delete the two forward slashes from line 11
and add two forward slashes in front of line 19

2.Some users were complaining that they couldn't see the "Player <winner> Wins the bet" and the other messages at the end of the race because it was going out of the chatbox too quickly.
Now i've added a box in the bottom right of the screen at the end of every race ,which gives information about the winner of the bet and the total win.

3.To prevent multiple clicking on the Accept button,the panel will dissapear the first time you click on it to accept/reject a bet.

And some other minor error fixes.
This version has been tested EXTENSIVELY from all possible angles,and each and every bug has been fixed. But despite this ,if you find any error ,since it hasn't been tested on modes other than laps, please report it.

Enjoy! :1


--------------------------------------------------------------------

Update v0.3
Some very intereting new upgrades in the betting plugin.
All of which a lot of you guys will like!
Upgrade:
#1 . Disabled chat based betting.
#2 . Instead of chat based, there are now manialinks for betting and accepting.
#3. For TIME ATTACK users who wanted a time limit on the betting, Well its been added. The betting panel will automatically be removed after 60 seconds ,so no one can bet after that. Also if someone bets,then the accepting panel comes up and it will dissapear in 30 seconds.
#4. ALL THE VALUES which appear on the panels -> currently set to 10 coppers,20,50,100 and 200 can be changed if you open my plugin, and all the values between the comments "CHANGE VALUES ONLY HERE FOR YOUR SERVER" can be changed to suit your needs - including the timeout for the betting panel and the accepting panel
#5 . Introduced a feature to record all the bets made by a user,total bets won by him and total bets lost by him into a table called "bet".
It can be viewed by typing ,"/topbets". I didn't spend much time on this,didn't think many people would even want this feature,also it has not yet been tested extensively ,but with the testing i've done,seems to work just fine.

For #5 to work do the following:
1.)Open your phpMyAdmin through your browser by typing 127.0.0.1
and login with "root" username and your password.
2.)There open your xaseco database from the column on the left and then find "Create new table on database xaseco" and there type in "bet" and no. of fields - 4 and click GO.
3.)In the new page : Type in the following:
1st Field: Nickname
TYPE : VARCHAR
LENGTH VALUE: 50
2nd Field: Totalbetmade
TYPE : INT
LENGTH VALUE: 10
3rd Field: Totalbetwin
TYPE : INT
LENGTH VALUE: 10
4th Field: Totalbetloss
TYPE : INT
LENGTH VALUE: 10

and click SAVE!


If you guys like the plugin and use it on your server,do come by my server and donate ! :)
tmtp://#join=vineeth_server

Enjoy!

:1


----------------------------------------------------------------------


Update v0.2:

1.Added "/beton" and "/betoff" to let the MASTERADMIN enable and disable the betting plugin.

AND
2.FINALLY, :gobananas: , :3 ,got both the plugin.donate.php and my betting plugin to coexist. Well i was trying to figure out how to make the changes only to my plugin to let it coexist, but failed to do so.So i had to make some minor changes in the plugin.donate.php, let me assure you,it doesn't change the donation process one bit,everything with that remains the same.

What i've done is ,cut the BillUpdated function from plugin.donate.php, pasted it into my billupdated function and added a if- else statement to check wheter it was a betting transaction or a donation transaction and added the variable globally in both.

Because of that,i've updated both the plugin.donate.php and my vineeth.bet.plugin.php and uploaded both of them together in my new release.

So extract and replace both the vineeth.bet.plugin and plugin.donate.php files

Download it from the download link above!


-------------------------------------------------------------------------

Betting Plugin v0.1
Right so this is ,i'm sure,the first betting plugin for Xaseco,one which many people have been looking around for!

I myself posted a topic here 2 months ago asking for a betting plugin! But no one replied ! :(
Now that i've been learning php for the last two weeks and made my first plugin - viewtopic.php?f=127&t=22341
I decided ,why not try the betting plugin !
I made the plugin by taking my laps server into account.
So o'course you might find many more flaws in it if you run a time attack server,but some of those flaws get cancelled out if its on laps mode .

I designed the plugin over the last 2 days and tested it on my server - tmtp://#join=vineeth_server for the last one day.
So far all the players have gotten their payments in coppers and doesn't seem like there's any major error in it.
Lots of echo's in the code ,which i put in to check for errors and still continuing to check,so haven't removed them yet.

INCLUDES 2 files, my betting plugin.php and the updated plugin.donate.php

to the plugins/ folder ,extract both the plugin.donate.php and vineeth.bet.plugin.php and add <plugin>vineeth.bet.plugin</plugin> to your plugins.xml file.



About the plugin:
1.Chat based betting. No panels yet.
2.Type "/bet <amount>" To start a bet
3.The message that you have started a bet is sent to everyone twice,yes twice,so that it covers the entire chatbox and no one misses the message.
4.Another player(s) can accept the bet by typing "/accept"
5.It can accept multiple acceptors.
6.To win the bet either the person who placed the bet,or one of the players who accepted the bet HAS TO finish 1st.
7.Payout is carried out and everyone gets a message saying Player <winner> has won the bet with a total win of <total win> coppers.
8.If no one wins, 50% of the coppers are returned to the better/acceptors.
Last edited by vineeth.h on 20 Sep 2009 16:13, edited 38 times in total.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [XAseco] Betting Plugin v0.1

Post by nouseforname » 29 Jul 2009 19:30

seems i can stop creating one. But i dont like the fact, disabling the donates plugin. it should be possible anyway. but also seems there will be a lot of improvements soon for ur plugin. anyway, good job.
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: [XAseco] Betting Plugin v0.1

Post by vineeth.h » 29 Jul 2009 19:42

Yeah nouse,i don't like disabling the donate either,and yeah it is possible to keep it as well,i'm working on it,don't want to release the update with only that improvement.So in a few days should have all the improvements released together - Just released this one at present,so that others can use it on their servers and if by some chance they find errors in the present code,they can post it,so i don't have to personally sit and test it for all the bugs-instead can work on the improvements.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

nouseforname
swift roadking
swift roadking
Posts: 840
Joined: 20 Apr 2008 08:58
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
Location: Germany
Contact:

Re: [XAseco] Betting Plugin v0.1

Post by nouseforname » 29 Jul 2009 20:25

just some ideas i had for my version.

- bet for another login / position
- a little maniacode window with 3 buttons to bet, each button with the amount of coppers.
- if one started a bet, this disappears and a new button appear for accept,the new button should display the amount of coppers.
- external configuration for the positions / size of the window/button.
- if bet lose, server acc keep coppers, if players whos was bet for left, pay back.

some more i dont know yet.

hope u like the ideas
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialinkcolor>

User avatar
jimos94
happy cruiser
happy cruiser
Posts: 122
Joined: 06 Jan 2007 22:52
Owned TM-games: TMUF
Manialink(s): fun
Contact:

Re: [XAseco] Betting Plugin v0.1

Post by jimos94 » 30 Jul 2009 00:30

Very Good Job mate! And let me tell my ideas too. The timelimit to place a bet is set according to the time attack's time limit (if it's TA of-course). Maybe a pop up message appears before the race for 3-5 seconds informing the player that the bets must be placed within 40 seconds (or what) when the race is started. Very good job! Keep it going!
http://www.tm-planet.net/ Server hosting, Interviews, Events and more :)

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: [XAseco] Betting Plugin v0.1

Post by vineeth.h » 30 Jul 2009 06:19

D
Last edited by vineeth.h on 30 Jul 2009 15:18, edited 2 times in total.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: [XAseco] Betting Plugin v0.1

Post by vineeth.h » 30 Jul 2009 06:28

nouseforname wrote:- a little maniacode window with 3 buttons to bet, each button with the amount of coppers.
I've seen the maniacode betting you're talking about in a server running FAST,looked good,but i decided to make it only after i perfected the chat based plugin -so i'll finish all my features with the chat based one first.
nouseforname wrote:seems i can stop creating one.
It would be good if you continued making it ,would love to see the maniacode based betting!
nouseforname wrote:- if bet lose, server acc keep coppers, if players whos was bet for left, pay back.
Lol ,keep coppers if no one wins?little harsh don't you think? I added 50% copper back in my latest update in the above post.
jimos94 wrote:Very Good Job mate! And let me tell my ideas too.The timelimit to place a bet is set according to the time attack's time limit (if it's TA of-course)
Ty! And call me selfish, :gobananas:,but putting the time limit wasn't a priority for me so far because ,as i said before i take my laps server into account,so you gotta bet during the warm up ,before the race starts ,cause if you try to bet inbetween the race,you're going to lose your lead! and probably won't win the race. So thats like an automatic time limit! :D
vineeth.h wrote:1.Remove plugin.donate.php from your plugins.xml file.
Now the error ,due to which you have to remove plugin.donate.php,is that, there is a onBillUpdated called in a function Xymph's plugin.donate.php plugin. I can't use the same function as the one which exists in that script ,so had to modify Xymph's bill updated function and put the modified one in my script.
But what happens is that,when the billupdated function is invoked in my script, it doesn't recognise my billupdated function in my own script, but goes over to the billupdated function in the plugin.donate.php and uses that.
So when a player types "/bet 10" ,it goes to the bill updated in donate.php and returns a message saying "Player <better> has donated 10 coppers to the server"!!!! :(
So that screws up the betting.

Thats the reason i asked you guys to remove plugin.donate.php from the plugins.xml temporarily.

If you can look into my billupdated function and look into the one in plugin.donate.php and find out what is causing this problem,that would be a big help!! Because i for one don't know why its happening.
Last edited by vineeth.h on 30 Jul 2009 17:31, edited 1 time in total.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

User avatar
jimos94
happy cruiser
happy cruiser
Posts: 122
Joined: 06 Jan 2007 22:52
Owned TM-games: TMUF
Manialink(s): fun
Contact:

Re: [XAseco] Betting Plugin v0.1

Post by jimos94 » 30 Jul 2009 10:38

vineeth.h wrote: Ty! And call me selfish, :gobananas:,but putting the time limit wasn't a priority for me so far because ,as i said before i take my laps server into account,so you gotta bet during the warm up ,before the race starts ,cause if you try to bet inbetween the race,you're going to loose your lead! and probably won't win the race. So thats like an automatic time limit! :D
Well then it works pretty good in laps mode but it would be awesome if it could work on TA too. Have you put it in your plans or just not yet? :P. And good luck with onBillUpdated function. Disabling the donation plugin is not the best thing ^^
http://www.tm-planet.net/ Server hosting, Interviews, Events and more :)

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: [XAseco] Betting Plugin v0.1.5

Post by vineeth.h » 30 Jul 2009 10:43

.
Last edited by vineeth.h on 30 Jul 2009 17:32, edited 3 times in total.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: [XAseco] Betting Plugin v0.1

Post by vineeth.h » 30 Jul 2009 10:49

jimos94 wrote: Well then it works pretty good in laps mode but it would be awesome if it could work on TA too. Have you put it in your plans or just not yet? :P.^^
Yeah. I did try to do it after reading your post,but didn't quite work. But I will try it again as and when i get time to do so.
jimos94 wrote:And good luck with onBillUpdated function. Disabling the donation plugin is not the best thing
I still can't figure out the problem!
Yeah i know disabling the donation plugin is not the best thing,i for one don't like it one bit because i get regular donations on my server,at the same time, most of the players on my server including myself seem to enjoy the betting plugin!
I hope someone using my plugin can help me figure out why thats happening! :)
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

dago
sunday driver
sunday driver
Posts: 61
Joined: 20 Feb 2009 18:43
Owned TM-games: tmuf

Re: [XAseco] Betting Plugin v0.1.5

Post by dago » 30 Jul 2009 13:40

Hi vineeth.h

Tried it on a time attack server and i have this error at the end of the race.

Fatal error: Call to undefined function int() in C:\xaseco\plugins\vineeth.bet.plugin.php on line 270

©D
join VITAMINEC
Servermania V 0.98
xaseco 1.10

vineeth.h
happy cruiser
happy cruiser
Posts: 116
Joined: 09 Mar 2009 09:47
Owned TM-games: TMUF

Re: [XAseco] Betting Plugin v0.1.5

Post by vineeth.h » 30 Jul 2009 15:14

dago wrote:Fatal error: Call to undefined function int() in C:\xaseco\plugins\vineeth.bet.plugin.php on line 270
On line 270 in the script, the line is $payback = int($bcoppers/2);

Change it to:

$payback = $bcoppers/2;


Updated the file on the link too.So check it out.
Last edited by vineeth.h on 30 Jul 2009 19:48, edited 2 times in total.
Owner of lllllNASCAR 80K
Join my server : NASCAR 80K

Image
Image

Xymph
Pit Crew
Pit Crew
Posts: 5654
Joined: 19 Aug 2007 12:58
Owned TM-games: TMN, TMU, TMF, TM²
Contact:

Re: [XAseco] Betting Plugin v0.1.5

Post by Xymph » 30 Jul 2009 15:50

vineeth.h wrote: On line 270 in the script, the line is $payback = int($bcoppers/2);
Hint, it's called floor in PHP. RTFM :wink:
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub

tchamba
cyclist
cyclist
Posts: 39
Joined: 06 Jul 2008 11:29
Owned TM-games: tmu
Location: France (28)

Re: [XAseco] Betting Plugin v0.1.5

Post by tchamba » 30 Jul 2009 16:54

Hi
the same prob to me is :
[PHP Warning] Aseco::require_once(plugins/vineeth.bet.plugin): failed to open stream: No such file or directory on line 651 in file C:\Serveurs\Xaseco_109\aseco.php
Fatal error: Aseco::require_once(): Failed opening required 'plugins/vineeth.bet.plugin' (include_path='.;C:\php5\pear') in C:\Serveurs\Xaseco_109\aseco.php on line 651
Last edited by tchamba on 30 Jul 2009 17:01, edited 1 time in total.

dago
sunday driver
sunday driver
Posts: 61
Joined: 20 Feb 2009 18:43
Owned TM-games: tmuf

Re: [XAseco] Betting Plugin v0.1.5

Post by dago » 30 Jul 2009 16:59

nouvelle erreur


Fatal error: Maximum execution time of 60 seconds exceeded in C:\xaseco\plugins\vineeth.bet.plugin.php on line 54

©D
join VITAMINEC
Servermania V 0.98
xaseco 1.10

Post Reply