Powered by Invision Power Board


Pages: (7) 1 2 [3] 4 5 ... Last » ( Go to first unread post ) Reply to this topicStart new topicStart Poll

> [MOD] Casino, play 2 games and win or lose upload
Ascii
Posted: Apr 30 2005, 08:34 AM
Quote Post


Power User
***

Group: Power Users
Posts: 59
Member No.: 4,145
Joined: 1-April 05



i keep getting a warning.
CODE

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/htdocs/web0/html/casinoweg.php:2) in /srv/www/htdocs/web0/html/include/bittorrent.php on line 433


i changed the
CODE
stdhead();

to
CODE
stdhead("Casino");


but i still get the error.
The header is changed
PMEmail PosterUsers Website
Top
nejx
Posted: Apr 30 2005, 08:38 AM
Quote Post


Power User
***

Group: Power Users
Posts: 252
Member No.: 2,942
Joined: 10-February 05



how "hungry" is this mod? does it uses lots of system resources?


--------------------
----------------------------------------------------------------------------
PMEmail Poster
Top
misterb
Posted: Apr 30 2005, 09:17 AM
Quote Post


Power User
***

Group: Power Users
Posts: 75
Member No.: 1,444
Joined: 17-December 04



Here's the players table:
CODE
<?

require "include/bittorrent.php";

dbconn(false);

loggedinorreturn();


ob_start("ob_gzhandler");


$res2 = mysql_query("select count(*) from casino") or die(mysql_error());
$row2 = mysql_fetch_array($res2);
$count = $row2[0];


$perpage = 50;

list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $_SERVER["PHP_SELF"] ."?" );

$res = mysql_query("select users.id as userid,users.username, users.downloaded,users.uploaded,casino.win,casino.lost from casino inner join users on casino.userid = users.id  ORDER BY (casino.win - casino.lost) DESC $limit") or sqlerr();

stdhead("Players");



if (mysql_num_rows($res) == 0)
print("<p align=center><b>No players</b></p>\n");
else
{
print("<p align=center><b><h1>Results</h1></b></p>\n");
print("<p align=center><a href=casino.php>Back</a></p>\n");
echo $pagertop;
print("<table border=1 cellspacing=0 cellpadding=5>\n");
print("<tr><td class=colhead>Username</td><td class=colhead align=left>Uploaded</td><td class=colhead align=left>Downloaded</td><td class=colhead align=left>Ratio</td><td class=colhead align=left>Won</td><td class=colhead align=left>Lost</td><td class=colhead align=left>Tries</td><td class=colhead align=left>Total</td>\n");

while ($arr = mysql_fetch_assoc($res))
{
$rez = mysql_query("select * from casino where userid=$arr[userid]");
$arz = mysql_fetch_array($rez);
if ($arr["downloaded"] > 0)
{
      $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
      $ratio = "<font color=" . get_ratio_color($ratio) . ">$ratio</font>";
   }
   else
      if ($arr["uploaded"] > 0)
        $ratio = "Inf.";
else
 $ratio = "---";
$uploaded =mksize($arr["uploaded"]);
$downloaded = mksize($arr["downloaded"]);
if ($CURUSER[id] == $arr[userid]) $bg = "bgcolor=#c0c0c0"; else $bg = "";
print("<tr><td $bg><a href=userdetails.php?id=$arr[userid]><b>$arr[username]</b></a></td><td align=left $bg>$uploaded</td><td align=left $bg>$downloaded</td><td align=left $bg>$ratio</td><td align=left $bg>".mksize($arz[win])."</td><td align=left $bg>".mksize($arz[lost])."</td><td align=left $bg>$arz[trys]</td><td align=left $bg>".mksize($arz[win]-$arz[lost])."</td></tr>\n");
}
print("</table>\n");
}


stdfoot();

?>


--------------------
Your bunny wrote...
PMEmail Poster
Top
Masters
Posted: Apr 30 2005, 09:23 AM
Quote Post


Power User
***

Group: Power Users
Posts: 60
Member No.: 2,627
Joined: 27-January 05



thx for players table.Fix Players Class Not work for my

QUOTE
//////////////////////////////////config
//////who is able to play just
//$player = UC_PEASANT;
//$player = UC_USER;
$player = UC_POWER_USER;
//$player = UC_VIP;
//$player = UC_UPLOADER;
//$player = UC_MODERATOR;
//$player = UC_ADMINISTRATOR;
//$player = UC_SYSOP;

if (get_user_class() <= $player)
PMEmail Poster
Top
marcoonline
Posted: Apr 30 2005, 09:26 AM
Quote Post


Power User
***

Group: Power Users
Posts: 40
Member No.: 3,548
Joined: 11-March 05



it works great

but i have only one problem

CODE
//////////////////////////////////config
//////who is able to play just
//$player = UC_Misbuiker;
$player = UC_USER;
$player = UC_POWER_USER;
$player = UC_VIP;
$player = UC_UPLOADER;
$player = UC_MODERATOR;
$player = UC_Springieuploader;
$player = UC_ADMINISTRATOR;
$player = UC_SYSOP;
$mb_basic=1024*1024;
$max_download_user = $mb_basic*1024*25; //// 25 GB
$max_download_global = $mb_basic*$mb_basic*2.5; //// 2.5 TB :-)
$required_ratio = 0.4; ///i think you know this
$max_trys = 50; ///50 games and no more


al users can play the game even UC_Misbruiker but that class most be denied to play somone a idee how i can de select that class from the game



--------------------
user posted image
PMEmail PosterUsers Website
Top
Ascii
Posted: Apr 30 2005, 09:38 AM
Quote Post


Power User
***

Group: Power Users
Posts: 59
Member No.: 4,145
Joined: 1-April 05



QUOTE (marcoonline @ Apr 30 2005, 09:26 AM)
CODE
//////////////////////////////////config
//////who is able to play just
//$player = UC_Misbuiker;
$player = UC_USER;
$player = UC_POWER_USER;
$player = UC_VIP;
$player = UC_UPLOADER;
$player = UC_MODERATOR;
$player = UC_Springieuploader;
$player = UC_ADMINISTRATOR;
$player = UC_SYSOP;
$mb_basic=1024*1024;
$max_download_user = $mb_basic*1024*25; //// 25 GB
$max_download_global = $mb_basic*$mb_basic*2.5; //// 2.5 TB :-)
$required_ratio = 0.4; ///i think you know this
$max_trys = 50; ///50 games and no more

you just have to uncommet the class from what the users are to play.

Example
//$player = UC_Misbuiker;
//$player = UC_USER;
//$player = UC_POWER_USER;
$player = UC_VIP;
//$player = UC_UPLOADER;
//$player = UC_MODERATOR;
//$player = UC_Springieuploader;
//$player = UC_ADMINISTRATOR;
//$player = UC_SYSOP;

every User higher than VIP is allowed to play. But not the VIP

This post has been edited by Ascii on Apr 30 2005, 09:39 AM
PMEmail PosterUsers Website
Top
Masters
Posted: Apr 30 2005, 09:40 AM
Quote Post


Power User
***

Group: Power Users
Posts: 60
Member No.: 2,627
Joined: 27-January 05



how fix this problem

This post has been edited by Masters on Apr 30 2005, 09:45 AM
PMEmail Poster
Top
Ascii
Posted: Apr 30 2005, 09:47 AM
Quote Post


Power User
***

Group: Power Users
Posts: 59
Member No.: 4,145
Joined: 1-April 05



CODE
//////////////////////////////////config
//////who is able to play just
//$player = UC_PEASANT;
//$player = UC_USER;
//$player = UC_POWER_USER;
//$player = UC_VIP;
//$player = UC_UPLOADER;
$player = UC_MODERATOR;
//$player = UC_ADMINISTRATOR;
//$player = UC_SYSOP;
$mb_basic=1024*1024;
$max_download_user = $mb_basic*1024*10; //// 10 GB
$max_download_global = $mb_basic*$mb_basic*2.5; //// 2.5 TB :-)
$required_ratio = 0.9; ///i think you know this
$max_trys = 25; ///25 games and no more

//////////////////this is the funny part
$user_everytimewin_mb = $mb_basic * 70; ////// means users that wins under 70 mb get a cheat_value of 0 -> win every time
$cheat_value = 2; // higher value -> less winner
$cheat_breakpoint = 2; ////very important value -> if (win MB > max_download_global/cheat_breakpoint)
$cheat_value_max = 5; ////// then cheat_value = cheat_value_max -->> i hope you know what i mean. ps: must be higher as cheat_value.
$cheat_ratio_user = 0.4; ///if casino_ratio_user > cheat_ratio_user -> $cheat_value = rand($cheat_value,$cheat_value_max)
$cheat_ratio_global = 0.4; /// same as user just global
$win_amount = 2; // how much do the player win in the first game eg. bet 300, win_amount=3 ---->>> 300*3= 900 win
$win_amount_on_number = 4; // same as win_amount for the number game
$show_real_chance = false; ///shows the user the real chance true or false
$bet_value1 = $mb_basic * 20; ///this is in MB but you can also choose gb or tb :-)
$bet_value2 = $mb_basic * 50;
$bet_value3 = $mb_basic * 100;
$bet_value4 = $mb_basic * 250;
$bet_value5 = $mb_basic * 500;
$bet_value6 = $mb_basic * 1024;
//$bet_value7 = $mb_basic * 2048;

//////////////////////////////////config end

if (get_user_class() <= $player)
stderr("Sorry ".$CURUSER["username"], "The MODERATOR do not allow your class to play casino");


works for me
PMEmail PosterUsers Website
Top
marcoonline
Posted: Apr 30 2005, 09:49 AM
Quote Post


Power User
***

Group: Power Users
Posts: 40
Member No.: 3,548
Joined: 11-March 05



i have try this one //////////////////////////////////config
//////who is able to play just
$player = UC_Misbuiker;
//$player = UC_USER;
//$player = UC_POWER_USER;
//$player = UC_VIP;
//$player = UC_UPLOADER;
//$player = UC_MODERATOR;
//$player = UC_Springieuploader;
//$player = UC_ADMINISTRATOR;
//$player = UC_SYSOP;

but even the SYSOP cant play :S


--------------------
user posted image
PMEmail PosterUsers Website
Top
marcoonline
Posted: Apr 30 2005, 09:53 AM
Quote Post


Power User
***

Group: Power Users
Posts: 40
Member No.: 3,548
Joined: 11-March 05



Tnx it works now i was forget to change this


From
CODE
if (get_user_class >= $player)

To
CODE
if (get_user_class() <= $player)


--------------------
user posted image
PMEmail PosterUsers Website
Top
Masters
Posted: Apr 30 2005, 09:59 AM
Quote Post


Power User
***

Group: Power Users
Posts: 60
Member No.: 2,627
Joined: 27-January 05



Not work fine
QUOTE
//////////////////////////////////config
//////who is able to play just
//$player = UC_PEASANT;
//$player = UC_USER;
//$player = UC_POWER_USER;
//$player = UC_VIP;
//$player = UC_UPLOADER;
$player = UC_MODERATOR;
//$player = UC_ADMINISTRATOR;
//$player = UC_SYSOP;
$mb_basic=1024*1024;
$max_download_user = $mb_basic*1024*10; //// 10 GB
$max_download_global = $mb_basic*$mb_basic*2.5; //// 2.5 TB :-)
$required_ratio = 0.9; ///i think you know this
$max_trys = 25; ///25 games and no more

//////////////////this is the funny part
$user_everytimewin_mb = $mb_basic * 70; ////// means users that wins under 70 mb get a cheat_value of 0 -> win every time
$cheat_value = 2; // higher value -> less winner
$cheat_breakpoint = 2; ////very important value -> if (win MB > max_download_global/cheat_breakpoint)
$cheat_value_max = 5; ////// then cheat_value = cheat_value_max -->> i hope you know what i mean. ps: must be higher as cheat_value.
$cheat_ratio_user = 0.4; ///if casino_ratio_user > cheat_ratio_user -> $cheat_value = rand($cheat_value,$cheat_value_max)
$cheat_ratio_global = 0.4; /// same as user just global
$win_amount = 2; // how much do the player win in the first game eg. bet 300, win_amount=3 ---->>> 300*3= 900 win
$win_amount_on_number = 4; // same as win_amount for the number game
$show_real_chance = false; ///shows the user the real chance true or false
$bet_value1 = $mb_basic * 20; ///this is in MB but you can also choose gb or tb :-)
$bet_value2 = $mb_basic * 50;
$bet_value3 = $mb_basic * 100;
$bet_value4 = $mb_basic * 250;
$bet_value5 = $mb_basic * 500;
$bet_value6 = $mb_basic * 1024;
//$bet_value7 = $mb_basic * 2048;

//////////////////////////////////config end

if (get_user_class() <= $player)
stderr("Sorry ".$CURUSER["username"], "The MODERATOR do not allow your class to play casino");
PMEmail Poster
Top
marcoonline
Posted: Apr 30 2005, 10:02 AM
Quote Post


Power User
***

Group: Power Users
Posts: 40
Member No.: 3,548
Joined: 11-March 05



this is my code and it works fine

CODE
/////////////////////////////////config
//////who is able to play just
$player = UC_Misbuiker;
//$player = UC_USER;
//$player = UC_POWER_USER;
//$player = UC_VIP;
//$player = UC_UPLOADER;
//$player = UC_MODERATOR;
//$player = UC_Springieuploader;
//$player = UC_ADMINISTRATOR;
//$player = UC_SYSOP;
$mb_basic=1024*1024;
$max_download_user = $mb_basic*1024*25; //// 25 GB
$max_download_global = $mb_basic*$mb_basic*2.5; //// 2.5 TB :-)
$required_ratio = 0.5; ///i think you know this
$max_trys = 25; ///25 games and no more

//////////////////this is the funny part
$user_everytimewin_mb = $mb_basic * 70; ////// means users that wins under 70 mb get a cheat_value of 0 -> win every time
$cheat_value = 1; // higher value -> less winner
$cheat_breakpoint = 2; ////very important value -> if (win MB > max_download_global/cheat_breakpoint)
$cheat_value_max = 5; ////// then cheat_value = cheat_value_max -->> i hope you know what i mean. ps: must be higher as cheat_value.
$cheat_ratio_user = 0.4; ///if casino_ratio_user > cheat_ratio_user -> $cheat_value = rand($cheat_value,$cheat_value_max)
$cheat_ratio_global = 0.4; /// same as user just global
$win_amount = 3; // how much do the player win in the first game eg. bet 300, win_amount=3 ---->>> 300*3= 900 win
$win_amount_on_number = 6; // same as win_amount for the number game
$show_real_chance = false; ///shows the user the real chance true or false
$bet_value1 = $mb_basic * 1; ///this is in MB but you can also choose gb or tb :-)
$bet_value2 = $mb_basic * 2;
$bet_value3 = $mb_basic * 5;
$bet_value4 = $mb_basic * 10;
$bet_value5 = $mb_basic * 20;
$bet_value6 = $mb_basic * 50;
$bet_value7 = $mb_basic * 100;

//////////////////////////////////config end

if (get_user_class() <= $player)
stderr("Sorry ".$CURUSER["username"], "Het team van springiestt heeft besloten dat jou class niet kan en mag mee spelen in het casino");


--------------------
user posted image
PMEmail PosterUsers Website
Top
Ascii
Posted: Apr 30 2005, 10:21 AM
Quote Post


Power User
***

Group: Power Users
Posts: 59
Member No.: 4,145
Joined: 1-April 05



@ masters

remember if you uncomment the moderators only Admins and the sysop is allowed to play.


i just got one think left
user posted image

who do i fix that nasty negative number.
It's should show up in MB and not kb

This post has been edited by Ascii on Apr 30 2005, 10:25 AM
PMEmail PosterUsers Website
Top
misterb
Posted: Apr 30 2005, 10:38 AM
Quote Post


Power User
***

Group: Power Users
Posts: 75
Member No.: 1,444
Joined: 17-December 04



replace this
CODE
print("<tr><td $bg><a href=userdetails.php?id=$arr[userid]><b>$arr[username]</b></a></td><td align=left $bg>$uploaded</td><td align=left $bg>$downloaded</td><td align=left $bg>$ratio</td><td align=left $bg>".mksize($arz[win])."</td><td align=left $bg>".mksize($arz[lost])."</td><td align=left $bg>$arz[trys]</td><td align=left $bg>".mksize($arz[win]-arz[lost])."</td></tr>\n");


with this
CODE
if (($arz[win]-$arz[lost]) < 0) $prize = "-".mksize($arz[lost]-$arz[win]);
else $prize = mksize($arz[win]-$arz[lost]);
print("<tr><td $bg><a href=userdetails.php?id=$arr[userid]><b>$arr[username]</b></a></td><td align=left $bg>$uploaded</td><td align=left $bg>$downloaded</td><td align=left $bg>$ratio</td><td align=left $bg>".mksize($arz[win])."</td><td align=left $bg>".mksize($arz[lost])."</td><td align=left $bg>$arz[trys]</td><td align=left $bg>".$prize."</td></tr>\n");


--------------------
Your bunny wrote...
PMEmail Poster
Top
Masters
Posted: Apr 30 2005, 10:47 AM
Quote Post


Power User
***

Group: Power Users
Posts: 60
Member No.: 2,627
Joined: 27-January 05



Oki Work Fine misterb Thx
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic OptionsPages: (7) 1 2 [3] 4 5 ... Last » Reply to this topicStart new topicStart Poll

 



[ Script Execution time: 0.0618 ]   [ 12 queries used ]   [ GZIP Enabled ]