Jump to content
MakeWebGames

Buyout of jail


Scipol

Recommended Posts

You're unable to view this code.

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

Very simple to do...

Note: I have no idea, if it will work on the newest MCCodes release, no idea what has changed within it.

Edited by Djkanna
Meh, don't do smileys within your codes comments. :| ^ added the v2 Redux notice
Link to comment
Share on other sites

You're unable to view this code.

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

 

Very simple to do...

Note: I have no idea, if it will work on the newest MCCodes release, no idea what has changed within it.

thanks for that i was wondering how i would add a link to jail.php i tried it and it did not work for me

Link to comment
Share on other sites

  • 2 months later...
I was bored, so decided to write this up real quick - Less than 5 minutes!

 

You're unable to view this code.

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

 

This is not tested, I did not even upload it to a server, but I can almost guarantee it works without an error.

Any problems, post back.

 

i hate to say this because i only know 1/100 of php but i think you didnt add the update for jail time

Link to comment
Share on other sites

Ive been trying to add an item instead of crystals for the last 2 hours still no joy :( Iam trying to learn code and i know this is an easy one to change but my eyes are burning from looking at this screen lol please show me how to add this item id 6

thanks

Link to comment
Share on other sites

<?php

require_once (dirname (__file__) .'/globals.php');

//Define the price.

$bailCost = 1; // Change

 

//Check for actually in jail.

if ($ir['jail'] > 0) {

//Check that they have enough item.php?ID=6 to continue.

if ($ir['item.php?ID=6'] > $bailCost) {

//Update the users, amount and jail amount.

$db->query ('UPDATE `users` SET `jail` = 0, `item.php?ID=6` = `item.php?ID=6` - '.$bailCost.' WHERE (`userid` = '.$userid.')');

echo '<p>You\'ve paid to get yourself out of jail...<a href="index.php" title="Back to home">Back to home</a></p>';

} else {

//Not enough lock picks message.

echo '<p>You cannot afford to buy yourself out of jail.<a href="index.php" title="Back to home">Back to home</a></p>';

}

} else {

//Not actually in jail at the time.

echo '<p>You\'re not currently in the jail.<a href="index.php" title="Back to home">Back to home</a></p>';

}

//Show footer

$h->endpage();

 

ithis is what i have now but i have tried it so many different ways i have tried with itemuse.php?ID item=id6 just dont know :(

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