Strats Posted April 6, 2009 Posted April 6, 2009 I have nearly got working marriage on my game lol But once you marry someone you can marry again, Like Mormons lol Can anyone take a look at the proposal.php and try to fix it? Also if you can please let me know what you changed so I can learn :) Thank you for anyone who takes the time to have a read. <?php /*----------------------------------------------------- -- Advanced Marriage Mod -- Product Copyright (c) Halo 2008 -- To be sold as freeware, do not re-sell -- Free for CE Members | Mccode V2 -----------------------------------------------------*/ include "globals.php"; if ($ir['married'] != 0) { die("You are already married"); } switch($_GET['action']) { case 'propose': propose_form(); break; case 'proposesub': propose_submit(); break; default: index(); break; } function index() { global $db,$ir,$c,$h,$userid; if ($ir['married'] != 0) { die("You are already married"); } else { print"<h1>Proposal Center</h1> Do you want to propose to someone? [url='propose.php?action=propose']> Yes[/url] [url='index.php']> No[/url]"; } } function propose_form() { global $db,$ir,$c,$h,$userid; if ($ir['married'] != 0) { die("You are already married"); } else { print"<h1>Proposal Center</h1> <form action='propose.php?action=proposesub' method='post'> Please enter the user id of the user you want to propose to: User: <input type='text' name='propose' /> Message: <input type='text' name='message' /> <input type='submit' value='Propose' /></form>"; } } function propose_submit() { global $db,$ir,$c,$h,$userid; if ($ir['married'] != 0) { die("You are already married"); } else if ($ir['userid'] == $_POST['propose']) { die("You cannot marry yourself"); } else { $ch=$db->query("SELECT * FROM proposals WHERE proPROPOSED={$_POST['propose']}"); if ($db->num_rows($ch)!=0) { die("This user already has a pending proposal, please try again later <a href=index.php>> Back</a>"); } else { $m=$db->query("SELECT * FROM users WHERE userid={$_POST['propose']}"); $r=$db->fetch_row($m); $db->query("INSERT INTO proposals VALUES('', '{$ir['userid']}', '{$_POST['propose']}', '{$_POST['message']}')"); event_add($_POST['propose'],"[url='viewuser.php?u=$userid']{$ir['username']} [{$ir['userid']}][/url] proposed to you Click [url='decision.php']<u>here</u>[/url] to make your mind up</a> ",$c); print"<h3>Proposal Center</h3> You proposed to {$r['username']} [{$r['userid']}], please wait for their decision "; } } } $h->endpage(); ?> ] Quote
AlabamaHit Posted April 6, 2009 Posted April 6, 2009 Re: Marriage Proposal if($ir['married'] > 1) { echo "No"; exit; } Quote
Magictallguy Posted April 7, 2009 Posted April 7, 2009 Re: Marriage Proposal if($ir['married'] > 1) { echo "No"; exit; } if($ir['married'] > 0) { echo "We don't believe in polygamy..."; $h->endpage(); exit; } //or if($ir['married']) { echo "We don't believe in polygamy"; $h->endpage(); exit; } Quote
Strats Posted April 7, 2009 Author Posted April 7, 2009 Re: Marriage Proposal Sorry, Neither of those have worked. Both just stopped people from proposing altogether. Quote
Karlos Posted April 7, 2009 Posted April 7, 2009 Re: Marriage Proposal if ($ir['married'] != '0') { echo 'Try Getting Divorced First, Before Re-Marrying...'; $h->endpage(); exit; } Quote
Lithium Posted April 7, 2009 Posted April 7, 2009 Re: Marriage Proposal All the answers should work, though you might be placing it on the wrong place Quote
Strats Posted April 7, 2009 Author Posted April 7, 2009 Re: Marriage Proposal That is very true, I will take a better look 8-) Quote
Lithium Posted April 7, 2009 Posted April 7, 2009 Re: Marriage Proposal @ Luke that was the point indeed, the wrong page... As of this it is fixed already :) Quote
Strats Posted April 7, 2009 Author Posted April 7, 2009 Re: Marriage Proposal Yup, Lithium has worked his magic again. My Marriage mod is a little bit altered than this now, Mine does not stop you marrying someone of the same sex and once you are married you cannot accept a proposal from someone else :) If anyone wants it mail me and I can send you it. To my knowledge I believe this is working perfectly. If anyone spots anything wrong let me know please. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.