Jump to content
MakeWebGames

Recommended Posts

Posted

basically just a change gym but i like it :)

cgym.php

<?php

/*

Crystal gym

modded by Solar

http://crime-city-07.freehostia.com

*/

session_start();

require "global_func.php";

if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }

$userid=$_SESSION['userid'];

require "header.php";

$h = new headers;

$h->startheaders();

include "mysql.php";

global $c;

$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());

$ir=mysql_fetch_array($is);

check_level();

$fm=money_formatter($ir['money']);

$lv=date('F j, Y, g:i a',$ir['laston']);

$out="";

$_GET['times']= abs((int) $_GET['times']);

if(isset($_GET['train']))

{

$tgain=0;

for($i=1;$i<=$_GET['times'] && $ir['crystals'] > 0;$i++)

{

if ($ir['crystals'] > 0)

{

$gain=rand(1,3)/rand(200,800)*rand(200,800)*(($ir['will']+20)/150);

$tgain+=$gain;

if ($_GET['train']=="IQ") { $gain/=100; }

$ir[$_GET['train']]+=$gain;

$egain=$gain/10;

$ts=$ir[$_GET['train']];

$st=$_GET['train'];

 

mysql_query("UPDATE userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or die("UPDATE userstats SET $st=$st+$gain,crystals=crystals-1,exp=exp+$egain WHERE userid=$userid

".mysql_error());

$wu=(int) (rand(1,3));

if ($ir['will'] >= $wu)

{

$ir['will']-=$wu;

mysql_query("UPDATE users SET crystals=crystals-1,exp=exp+$egain,will=will-$wu WHERE userid=$userid",$c);

}

else

{

$ir['will']=0;

mysql_query("UPDATE users SET crystals=crystals-1,exp=exp+$egain,will=0 WHERE userid=$userid",$c);

}

$ir['crystals']-=1;

$ir['exp']+=$egain;

}

else

{

$out="You do not have enough crystals to train.";

}

}

$stat=$ir[$st];

$i--;

$out="You begin training your $st.

You have gained $tgain $st by training it $i times.

You now have $stat $st and {$ir['crystals']} crystals left.

";

}

else

{

$out="

Crystal Gym: Main Lobby

";

}

$h->userdata($ir,$lv,$fm);

$h->menuarea();

print $out;

print "Enter the amount of times you wish to train and choose the stat to train.

You can train up to {$ir['crystals']} times.

 

Strength

Speed

Work Skill

Defence

 

";

$h->endpage();

?>

then open mainmenu.php and find the href section and under Gym add

a link to cgym.php

Posted

Re: [FREE][CRYSTAL GYM]

Thanks :-D first time i tryed i kept getting an error saying abusers not allowed but i managed to get rid of dat lol

  • 3 weeks later...
Posted

Re: [FREE][CRYSTAL GYM]

Any ideas on how to use on V2? havent had much time to mess with it much, but when i go to the gym is uses the number of crystals i have to train, ex. 5000= you can train up to 5000 times lol. If i have time to figure it out i'll let yall know.

  • 2 weeks later...
Posted

Re: [FREE][CRYSTAL GYM]

V1 slightly improved

cgym.php

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

i only made it because some people were asking for it. I wasnt going to use i just thought it might be useful for some people

  • 1 month later...
Posted

Re: [FREE][CRYSTAL GYM]

Does anyone have this is V2?

R

<?php

/*

Crystal gym

modded by Solar

http://crime-city-07.freehostia.com

*/

session_start();

require "global_func.php";

if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }

$userid=$_SESSION['userid'];

require "header.php";

$h = new headers;

$h->startheaders();

include "mysql.php";

global $c;

$is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error());

$ir=mysql_fetch_array($is);

check_level();

$fm=money_formatter($ir['money']);

$lv=date('F j, Y, g:i a',$ir['laston']);

$out="";

$_GET['times']= abs((int) $_GET['times']);

if(isset($_GET['train']))

{

$tgain=0;

for($i=1;$i<=$_GET['times'] && $ir['crystals'] > 0;$i++)

{

if ($ir['crystals'] > 0)

{

$gain=rand(1,3)/rand(200,800)*rand(200,800)*(($ir['will']+20)/150);

$tgain+=$gain;

if ($_GET['train']=="IQ") { $gain/=100; }

$ir[$_GET['train']]+=$gain;

$egain=$gain/10;

$ts=$ir[$_GET['train']];

$st=$_GET['train'];

 

mysql_query("UPDATE userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or die("UPDATE userstats SET $st=$st+$gain,crystals=crystals-1,exp=exp+$egain WHERE userid=$userid

".mysql_error());

$wu=(int) (rand(1,3));

if ($ir['will'] >= $wu)

{

$ir['will']-=$wu;

mysql_query("UPDATE users SET crystals=crystals-1,exp=exp+$egain,will=will-$wu WHERE userid=$userid",$c);

}

else

{

$ir['will']=0;

mysql_query("UPDATE users SET crystals=crystals-1,exp=exp+$egain,will=0 WHERE userid=$userid",$c);

}

$ir['crystals']-=1;

$ir['exp']+=$egain;

}

else

{

$out="You do not have enough crystals to train.";

}

}

$stat=$ir[$st];

$i--;

$out="You begin training your $st.

You have gained $tgain $st by training it $i times.

You now have $stat $st and {$ir['crystals']} crystals left.

";

}

else

{

$out="<h3>Crystal Gym: Main Lobby<h3>";

}

$h->userdata($ir,$lv,$fm);

$h->menuarea();

print $out;

print "Enter the amount of times you wish to train and choose the stat to train.

You can train up to {$ir['crystals']} times.

<form action='cgym.php' method='get'>

<input type='text' name='times' value='1' /><select type='dropdown' name='train'>

<option value='strength'>Strength</option>

<option value='agility'>Speed</option>

<option value='labour'>Work Skill</option>

<option value='guard'>Defence</option></select>

<input type='submit' value='Train!' /></form>";

$h->endpage();

?>

Posted

Re: [FREE][CRYSTAL GYM]

V2 here it is EASy

<?php

include "globals.php";

print $out;

print "Enter the amount of times you wish to train and choose the stat to train.

You can train up to {$ir['crystals']} times.

<form action='cgym.php' method='get'>

<input type='text' name='times' value='1' /><select type='dropdown' name='train'>

<option value='strength'>Strength</option>

<option value='agility'>Speed</option>

<option value='labour'>Work Skill</option>

<option value='guard'>Defence</option></select>

<input type='submit' value='Train!' /></form>";

$h->endpage();

?>

Posted

Re: [FREE][CRYSTAL GYM]

hey ive tried to get it working but cant seem to im getting this error,

Fatal error: Cannot redeclare class headers in /home/shadowu/public_html/header.php on line 4

here is the code, please tell me whats wrong lol?

<?php

session_start();

include "globals.php";

$userid=$_SESSION['userid'];

if($_SESSION['loggedin']==0) { header("Location: login.php");exit; }

include "header.php";

$h = new headers;

$h->startheaders();

include "mysql.php";

global $db,$c;

$is=mysql_query("SELECT

u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid

WHERE u.userid=$userid",$c) or die(mysql_error());

$ir=mysql_fetch_array($is);

check_level();

$fm=money_formatter($ir['money']);

$lv=date('F j, Y, g:i a',$ir['laston']);

$out="";

$_GET['times']= abs((int) $_GET['times']);

if(isset($_GET['train']))

{

$tgain=0;

for($i=1;$i<=$_GET['times'] && $ir['crystals'] > 0;$i++)

{

if ($ir['crystals'] > 0)

{

$gain=rand(1,3)/rand(200,800)*rand(200,800)*(($ir['will']+20)/150);

$tgain+=$gain;

if ($_GET['train']=="IQ") { $gain/=100; }

$ir[$_GET['train']]+=$gain;

$egain=$gain/10;

$ts=$ir[$_GET['train']];

$st=$_GET['train'];

 

mysql_query("UPDATE

userstats SET $st=$st+".$gain." WHERE userid=$userid",$c) or

die("UPDATE userstats SET

$st=$st+$gain,crystals=crystals-1,exp=exp+$egain WHERE

userid=$userid

".mysql_error());

$wu=(int) (rand(1,3));

if ($ir['will'] >= $wu)

{

$ir['will']-=$wu;

mysql_query("UPDATE users SET crystals=crystals-1,exp=exp+$egain,will=will-$wu WHERE userid=$userid",$c);

}

else

{

$ir['will']=0;

mysql_query("UPDATE users SET crystals=crystals-1,exp=exp+$egain,will=0 WHERE userid=$userid",$c);

}

$ir['crystals']-=1;

$ir['exp']+=$egain;

}

else

{

$out="You do not have enough crystals to train.";

}

}

$stat=$ir[$st];

$i--;

$out="You begin training your $st.

You have gained $tgain $st by training it $i times.

You now have $stat $st and {$ir['crystals']} crystals left.

";

}

else

{

$out="<h3>Crystal Gym: Main Lobby<h3>";

}

$h->userdata($ir,$lv,$fm);

$h->menuarea();

print $out;

print "Enter the amount of times you wish to train and choose the stat to train.

You can train up to {$ir['crystals']} times.

<form action='cgym.php' method='get'>

<input type='text' name='times' value='1' /><select type='dropdown' name='train'>

<option value='strength'>Strength</option>

<option value='agility'>Speed</option>

<option value='labour'>Work Skill</option>

<option value='guard'>Defence</option></select>

<input type='submit' value='Train!' /></form>";

$h->endpage();

?>

Posted

Re: [FREE][CRYSTAL GYM]

 

hey ive tried to get it working but cant seem to im getting this error,

Fatal error: Cannot redeclare class headers in /home/shadowu/public_html/header.php on line 4

here is the code, please tell me whats wrong lol?

are you tring to get this to work on V2...if so code is wrong

V2 here it is EASy

<?php

include "globals.php";

print $out;

print "Enter the amount of times you wish to train and choose the stat to train.

You can train up to {$ir['crystals']} times.

<form action='cgym.php' method='get'>

<input type='text' name='times' value='1' /><select type='dropdown' name='train'>

<option value='strength'>Strength</option>

<option value='agility'>Speed</option>

<option value='labour'>Work Skill</option>

<option value='guard'>Defence</option></select>

<input type='submit' value='Train!' /></form>";

$h->endpage();

?>

 

thats for V2
Posted

Re: [FREE][CRYSTAL GYM]

you cant just have

<?php

include "globals.php";

print $out;

print "Enter the amount of times you wish to train and choose the stat to train.

You can train up to {$ir['crystals']} times.

<form action='cgym.php' method='get'>

<input type='text' name='times' value='1' /><select type='dropdown' name='train'>

<option value='strength'>Strength</option>

<option value='agility'>Speed</option>

<option value='labour'>Work Skill</option>

<option value='guard'>Defence</option></select>

<input type='submit' value='Train!' /></form>";

$h->endpage();

?>

as it doesnt work :S?
Posted

Re: [FREE][CRYSTAL GYM]

Please people use

[code*][/code*] when wanting to post code, not quotes.

- Remove *'s when posting code, and code goes between

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

like that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...