Jump to content
MakeWebGames

[Request] Currency Trader


Nameless

Recommended Posts

Hello MWG, I would like to make a request for someone to create a simple modification for my game.

What is it?: This modification is very similar to the "crystal temple".

I have more than 1 currency in my game, Money, Crystals, "another currency" so on...

I would like my users to be able to trade their hard earned "third currency" in for special rewards.

These are:

100% Will Refill

100% Brave Refill

100% Health Refill

ITEM 1 (I would like it to use the item_add function)

ITEM 2 (I would like it to use the item_add function)

ITEM 3 (I would like it to use the item_add function)

That's about it.

I will tell you the DB name of my currency if you want to take on the job via PM.

I would like it if you guys could tell me your price to create this modification, As that's usually the sellers choice, And not the buyers.

Thank you.

Link to comment
Share on other sites

here i started it if you want to Finnish it.

You will need to change "currency" to your actual currency also i did not add any checks to see if they already have max brave

 

<?php

include(__DIR__.'/globals.php');

if(isset($_GET['refilb'])) {
$bcost = 20; # 20 currency
if($ir['currency'] < $bcost) {
	echo "Sorry but you dont have enough to refil your brave.";
	$h->endpage();
	exit;
}
else {
	echo "You have paid ".number_format($bcost)." to refill your brave.";
	$db->query("UPDATE `users` SET `brave` = `maxbrave`,`currency` = `currency` - '$bcost' WHERE `userid` = '$userid'");
}
}

if(isset($_GET['refilw'])) {}
if(isset($_GE['refilh'])) {}

if(isset($_GET['itemone'])) {
$icost = 100; # 100 currency
if($ir['currency'] < $icost) {
	echo "Sorry but you dont have enough for this item you need".number_format($icost - $ir['currency'])."";
	$h->endpage();
	exit;
}
else {
	echo "You have paid ".number_format($icost)." for <strong>Item Name</strong>.";
	$db->query("UPDATE `users` SET `currency` = `currency` - '$icost' WHERE `userid` = '$userid'");
	item_add($userid, 9, 1); # 9 is for the id of the item the 1 is the amount they recive.
}
}
if(isset($_GET['itemtwo'])) {}
if(isset($_GET['itemthree'])) {}

echo "<h2>Shop</h2><hr width='50%'>
<i>here you can trade your Currency for stuff</i>";
echo "
<table class='table'>
<tr>
	<th>Refill Brave</th>
	<th>Refill Will</th>
	<th>Refill Health</th>
	<th>Item one</th>
	<th>Item two</th>
	<th>Item three</th>
</tr>
<tr>
	<td>".number_format($bcost)." currency <a href='cshop.php?refilb'>[Refil Brave]</a></td>
	<td></td>
	<td></td>
	<td>".number_format($icost)." currency <a href='cshop.php?itemone'>[buy Item]</a></td>
	<td> currency <a href='cshop.php?itetwo'>[buy Item]</a></td>
	<td> currency <a href='cshop.php?itethree'>[buy Item]</a></td>
      </tr>
</table>";
$h->endpage();
?>
Edited by NonStopCoding
Link to comment
Share on other sites

I didnt put much effort into it but here it is. Fair warning I am using eval() on here so be careful

here are some screen shots as well:

Player View

oXCrbCjl.png

Admin Add New

HetM9lBl.png

Admin Add New (with drop down)

T3Mgc6Ll.png

Admin View

TRVOvizl.png

Edit

HWzw6HFl.png

Delete:

KcGKMzal.png

Here is the link

https://github.com/KyleMassacre/MCC-Currency-Trader

License is GNU V2 so use at your own risk. It should be ok as long as you don't let people access you don't trust

**Edit**

I would like to add that in the `call_back` you can do anything in there so if you would like it to cost an item you can use the item_remove function but with that being said be careful because someone can really hurt you game with this

Edited by KyleMassacre
Changed license
Link to comment
Share on other sites

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