Jump to content
MakeWebGames

[Free] [v1] Calculator Mod


Isomerizer

Recommended Posts

I had to make a php based calculator for a quest i made on my game so people can work out questions, seeing as some normal calculators couldnt multiply IP address's. So i made this calculator mod for your game, Its simple, but can be handy if you have riddles / missions requiring maths :P

Create new file called "calculator.php" with:

 

You're unable to view this code.

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

 

Open "explore.php" and find:

 

You're unable to view this code.

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

 

Just before the

add:

 

You're unable to view this code.

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

 

There your calculator will be located under City, now just under Users Online.

Link to comment
Share on other sites

Re: [Free] [v1] Calculator Mod

i think this is v2 but im not sure my first time converting v1 to v2 correct me if i am wrong

 

 

<?php

include "globals.php";

$numbera=$_POST['numbera'];

$numberb=$_POST['numberb'];

$do=$_POST['do'];

print "<h1>Calculation Wizard</h1>";

if ($numbera=="" || $numberb=="" || $calculation="")

{

print "You approach the wise old wizard, he tells you he can work out any sort of sum...

Work this out then smart ass:

";

print "<form action=calculator.php method=POST>

<input type=number name=numbera style='width:50px;'>

<select name=do>

<option value=times>x</option>

<option value=plus>+</option>

<option value=minus>-</option>

<option value=divide>/</option>

</select>

<input type=number name=numberb style='width:50px;'>

<input type=submit value=Calculate></form>

(Dont try typing in letters i'll just give you the answer 0)";

}

else

{

if ($do=="times")

{

$answertimes=$numbera*$numberb;

print "Oh..Thats an easy one, the answer is:

";

print "$numbera x $numberb = $answertimes";

print "

<a href=calculator.php>Back</a>";

}

if ($do=="plus")

{

$answerplus=$numbera+$numberb;

print "Oh..Thats an easy one, the answer is:

";

print "$numbera + $numberb = $answerplus";

print "

<a href=calculator.php>Back</a>";

}

if ($do=="minus")

{

$answerminus=$numbera-$numberb;

print "Oh..Thats an easy one, the answer is:

";

print "$numbera - $numberb = $answerminus";

print "

<a href=calculator.php>Back</a>";

}

if ($do=="divide")

{

$answerdivide=$numbera/$numberb;

print "Oh..Thats an easy one, the answer is:

";

print "$numbera / $numberb = $answerdivide";

print "

<a href=calculator.php>Back</a>";

}

}

?>

<?

$h->endpage();

?>

Link to comment
Share on other sites

  • 2 weeks later...

Re: [Free] [v1] Calculator Mod

When i used iseeyou94056's version translation, it works but i get this error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/downt12/public_html/calculator.php:2) in /home/downt12/public_html/globals.php on line 6

Which is kind of annoying, when i use 03laceys 2nd version, it doesnt work, comes up with some error on line 11 but someone pointed out that- that was V1 again soooo, then i tried 03laceys first translation, and it works perfectly, nice work man :-D

Link to comment
Share on other sites

  • 10 months later...

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...