-
Posts
244 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by Analog
-
mouse Wired or Wireless
-
Based on what you have that is correct.... What you could do here is when a proposal is accepted you add one to that field. Then you store the associated player in a different table and call that data when needed.
-
Currently I am looking for some work to make a little cash. I'm not looking for anything to make me rich just a little extra cash to use for development of my own projects. I can offer work in the following areas PHP MySql HTML CSS light YUI some JS I do have a couple of game modifications posted here on MWG http://makewebgames.io/showthread.php/37170-Gang-Shop-Gang-Replacement-by-Floydian http://makewebgames.io/showthread.php/36547-Gang-Status My offer is not limited to just MC Codes, I have worked with multiple CMS platforms, forum systems, and other odd website add ons. Also will do stand alone systems. Terms Of Service - Support will be offered via email or msn for no less than 90 days after project completion. - All payments will be in USD via paypal - Basic project details, screen shots, and relative links will be posted in my portfolio - 50% deposit required for any work done outside of my own hosting If you are interested in hiring me to do some work, contact me with details of what you are looking for... via PM here on MWG MSN - [email protected] Email - [email protected]
-
With an out of the box setup it is only used in training. Will Potions refill the players will to keep it higher for better training.... With a little imagination though Will Power can be used for many different things. Could be incorporated into crimes, finding items, fighting, etc, etc, .... just about everything... lol I believe with the standard MC Codes setup will should reduce as the player trains and refill over time.
-
I started exploring the use of the yui library and just working with some stuff I've found through google to try and get a fill for how it works. To start I went through a tutorial for a simple yui ajax call. I call the ajax with the following which seems to work fine, it loads as desired. When js is disabled it ignores the onclick and uses the normal file. [url='sendcash.php?ID={$player[']Send Cash[/url] js function (/ajax/ajax.php) function yui_load(folder,file,id) { var loadUrl = './ajax/'+encodeURIComponent(folder)+'/'+encodeURIComponent(file)+'.php?id='+encodeURIComponent(id); var callback = { success: function(o) { document.getElementById('ajax_out').innerHTML = o.responseText; }, failure: function(o) { alert("AJAX doesn't work"); //FAILURE } } var transaction = YAHOO.util.Connect.asyncRequest('GET', loadUrl, callback, null); return false; } Once the link is clicked with js enabled it loads this file via the above function /ajax/user_view/send_cash_form.php <?php print <<<EOF <script src='../../ajax/yahoo-min.js'></script> <script src='../../ajax/event-min.js'></script> <script src='../../ajax/connection-min.js'></script> <script type="text/javascript"> // hijack the form once the DOM is in a ready state YAHOO.util.Event.onDOMReady(function() { hijackForm("exampleForm", "ajaxDiv"); }); function hijackForm(formId, updateId) { var formObj = document.getElementById(formId); // this is the callback for the form's submit event var submitFunc = function (e) { // prevent default form submission YAHOO.util.Event.preventDefault(e); // define a YUI callback object var callback = { success: function(o) { document.getElementById(updateId).innerHTML = o.responseText; }, failure: function(o) { alert("AJAX request failed!"); } } // connect to the form and submit it via AJAX YAHOO.util.Connect.setForm(formObj); YAHOO.util.Connect.asyncRequest(formObj.method, formObj.action, callback); } // call our submit function when the submit event occurs YAHOO.util.Event.addListener(formObj, "submit", submitFunc); } </script> <form id="exampleForm" method="post" action="ajax/view_user/send_cash.php"> <div> Text: <input type="text" name="text"/> <input type="submit" value="Submit"/> </div> </form> <div id="ajaxDiv"></div> EOF; ?> When the form is submitted it calls this file /ajax/view_user/send_cash.php <?php // use to detect an XHR request define('IS_AJAX', !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); // only show document head markup if it's an XHR request if (!IS_AJAX) { echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '; echo '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> '; echo '<html xmlns="http://www.w3.org/1999/xhtml">'; echo '<head><title>Form Submission</title></head><body>'; } // this is the same for HTTP and XHR requests if (empty($_POST['text'])) die("You did not input anything"); $text = htmlentities($_POST['text']); echo "You entered: $text"; // only if it's an XHR request if (!IS_AJAX) { echo '</body></html>'; } ?> Now here is what happens. User clicks on send cash link, form displays via ajax as desired.... user inputs to form field, clicks submit, and it loads /ajax/view_user/send_cash.php outside of the page instead of via ajax I believe from what I've read, along with the comments in the code, that the reason it is not working is because headers are not being sent when the form is submitted. So based on the code it sends new headers out. If i load just the form page (have to modify the action="" of the form), it works as it should, but not when the form is called via ajax then submitted. After many failed attempts to correct the problem and get the desired out come, I need pointed in the right direction. send_cash.php & send_cash_form.php are simple files from a tutorial that i found via google, js function based on one from another tutorial found via google.
-
Good - prevents bots creating 1000s of accounts providing you store the users information in a temporary location until email is confirmed - gives you away to contact users outside of the site/game environment, comes in especially handy if you are trying to survey why users are leaving - provides another way to limit multiple accounts
-
dead port on modem? dead nic card? local area/lan connection disabled?
-
Looks like you have put some good thought behind this. I have designed a similar system in the past on a game but not quite as in-depth as what you have listed. In any case, your idea would be very useful for staff members and game owners.
-
Very nice outcome of what a little bit of time spent on learning can produce. I'm no graphics guru, infact my graphics suck... anyways.. very nice 1st design
-
In your example you selected cmID, cmQTY, cmPRICE from the crystalmarket table. There is nothing being selected from the users table. So why did you join the users table with the crystalmarket table?
-
Your table has 17 fields in it. Your insert SQL only contains 13. [mysql] CREATE TABLE IF NOT EXISTS `gangs` ( `gangID` int(11) NOT NULL auto_increment, `gangNAME` varchar(255) NOT NULL default '', `gangDESC` text NOT NULL, `gangPREF` varchar(12) NOT NULL default '', `gangSUFF` varchar(12) NOT NULL default '', `gangMONEY` bigint(65) NOT NULL default '0', `gangCRYSTALS` bigint(65) NOT NULL default '0', `gangRESPECT` int(11) NOT NULL default '0', `gangPRESIDENT` int(11) NOT NULL default '0', `gangVICEPRES` int(11) NOT NULL default '0', `gangCAPACITY` int(11) NOT NULL default '0', `gangCRIME` int(11) NOT NULL default '0', `gangCHOURS` int(11) NOT NULL default '0', `gangAMENT` longtext NOT NULL, `gangSIG` varchar(255) NOT NULL, `gangSIG2` varchar(255) NOT NULL, `gangSTATUS` text NOT NULL, PRIMARY KEY (`gangID`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ; [/mysql] Try this for your insert sql [mysql] $db->query("INSERT INTO gangs VALUES('', '$name', '$desc', '', '', 0, 0, 100, $userid, 0, 5, 0, 0, '', '', '', 0)"); [/mysql]
-
Have you made sure you are only calling the function once?
-
didn't think about that... The unexpected t string was probably because of the ' ' used within the style tag i posted.. but hey... at least it got you looking in the right direction ;)
-
line 41 if($ir['willmax'] > 100) should be if($ir['maxwill'] > 100)
-
function menuarea() { include "mainmenu.php"; global $ir,$c; print '</td><td width="2" class="linegrad" bgcolor="#'.$bgcolor.'"></td><td width="80%" bgcolor="#'.$bgcolor.'" valign="top"> <center>'; if($ir['hospital']) { print "[b]NB:[/b] You are currently in hospital for {$ir['hospital']} minutes. "; } if($ir['jail']) { print "[b]NB:[/b] You are currently in jail for {$ir['jail']} minutes. "; } print "[url='Donate.php'][b]Donate to {$set['game_name']} now for game benefits![/b][/url] "; } This should be what you need to edit. It is the opening for the right hand side of your layout (the black area). <td width="80%" bgcolor="#'.$bgcolor.'" valign="top"> Could change it to... <td width="80%" style="background-image:url('images/colbg.png');" valign="top">
-
I've ran across an issue that I'm not sure how to fix. BB Code $this->engine->cust_tag("/\[codebox\](.+?)\[\/codebox\]/","<div class='codetop'>CODE</div><div class='codemain'><code>\\1</code></div>"); Now the problem is that if input something like [codebox][b]test to disply[/b][/codebox] It will render the bold bbcode tag instead of displaying it. Any ideas?
-
I'd have to agree with WRX A simple list of members would not provide enough details on how a particular member is to work with. Using a review method, where details of the work requested, time frame, transaction, etc would provide much more valuable information to members looking for someone to work with.
-
Random colors... very interesting
-
did you also add: mysql_query($q_set); So that the query runs?
-
I replaced the use of die("") with return... If it were being used on my game it would have been error_output("text to display"); echo versus print.. blah... personal preference on that really. The deference in speed is so little that to me it makes no difference
-
its in the users table... [mysql]ALTER TABLE `users` CHANGE `money` `money` BIGINT NOT NULL DEFAULT '0'[/mysql]
-
Why use die("")? The $cost/$stat variables was already in the original code, why not try looking at it first...
-
<?php include "globals.php"; if($ir['hospital']) { print "This page cannot be accessed while in hospital."; return; } if($_GET['action'] == "escape") { if($ir['jail'] == 0) { print "You arent in jail! > [url='jail.php']Back[/url]"; return; } $cost = 5; $stat = 'brave'; if($ir['brave'] < 5) { print "You need $cost $stat to escape from jail! > [url='jail.php']Back[/url]"; return; } $db->query("update users set $stat = $stat - $cost where userid = $userid"); if(rand(1,100) <= 50) { print "You successfully broke out of the {$set['game_name']} Jail! > [url='jail.php']Back[/url]"; $db->query("UPDATE users SET jail = 0 WHERE userid = $userid"); return; } else { $jailtime = (int) rand(1,30); print "You were caught attempting to break out of the {$set['game_name']} Jail. The officers beat you for a while and added $jailtime minutes to your sentence! > [url='jail.php']Back[/url]"; $db->query("UPDATE users SET jail=jail+$jailtime, busted=busted+1, jail_reason='Caught attempting to escape' WHERE userid=$userid"); return; } } if($_GET['action'] == "bail") { if($ir['jail']) { print "You cannot bail out people while in jail! > [url='jail.php']Back[/url]"; return; } $_GET['ID'] = abs((int) $_GET['ID']); $r = $db->query("SELECT * FROM users WHERE userid={$_GET['ID']}")); if(!$db->fetch_row($r)) { print "Invalid user"; } $r = $db->fetch_row($r); if(!$r['jail']) { print "That user is not in jail! > [url='jail.php']Back[/url]"; return; } $cost = $r['level'] * 2000; $cf = number_format($cost); if($ir['money'] < $cost) { print "Sorry, you do not have enough money to bail out {$r['username']}. You need \$$cf. > [url='jail.php']Back[/url]"; return; } print "You successfully bailed {$r['username']} out of jail for \$$cf. > [url='jail.php']Back[/url]"; $db->query("UPDATE users SET busts=bails+1, money=money-{$cost} WHERE userid=$userid"); $db->query("UPDATE users SET jail=0 WHERE userid={$r['userid']}"); event_add($r['userid'], "[url='viewuser.php?u={$ir[']{$ir['username']}[/url] bailed you out of jail.", $c); } if($_GET['action'] == "bust") { if($ir['energy'] <= 9) { print "Sorry, it costs 10 energy to bust someone. You only have {$ir['energy']} energy. Come back later."; return; } if($ir['jail']) { print "You cannot bust out people while in jail."; return; } $_GET['ID'] = abs((int) $_GET['ID']); $q = $db->query("SELECT * FROM users WHERE userid={$_GET['ID']}"); $r = $db->fetch_row($q); if(!$r['userid']) { print "Invalid user"; return; } if(!$r['jail']) { print "That user is not in jail!"; return; } $mult = $r['level']*$r['level']; $chance = min(($ir['crimexp']/$mult) * 50 + 1, 95); if(rand(1,100) < $chance) { $gain = $r['level'] * 5; print "You successfully busted {$r['username']} out of jail. > [url='jail.php']Back[/url]"; $db->query("UPDATE users SET crimexp=crimexp+{$gain} WHERE userid=$userid"); $db->query("UPDATE users SET jail=0 WHERE userid={$r['userid']}"); event_add($r['userid'], "[url='viewuser.php?u={$ir[']{$ir['username']}[/url] busted you out of jail.", $c); } else { print "While trying to bust out your friend, a guard spotted you and dragged you into jail yourself. Unlucky! > [url='jail.php']Back[/url]"; $time = min($mult, 100); $db->query("UPDATE users SET jail=$time, jail_reason='Caught trying to bust out {$r['username']}' WHERE userid=$userid"); event_add($r['userid'], "[url='viewuser.php?u={$ir[']{$ir['username']}[/url] was caught trying to bust you out of jail.", $c); } } print "<h3>{$set['game_name']} Jail</h3> "; if($ir['jail']) { print "[url='jail.php?action=escape']Escape[/url] | [url='jail.php?action=court']<strike>Goto Court</strike>[/url]"; } print " <table width='100%' class=\"table\" border=\"0\" cellspacing=\"1\"><tr bgcolor=gray><th>Name</th> <th>Level</th> <th>Time</th><th>Reason</th> <th>Actions</th></tr>"; $q = $db->query("SELECT u.*,c.* FROM users u LEFT JOIN gangs c ON u.gang=c.gangID WHERE u.jail > 0 ORDER BY u.jail DESC"); while($r = $db->fetch_row($q)) { print "<tr><td>{$r['gangPREFIX']} [url='viewuser.php?u={$r[']{$r['username']}[/url] [{$r['userid']}]</td><td>{$r['level']}</td><td>{$r['jail']} minutes</td><td>{$r['jail_reason']}</td> <td>[[url='jail.php?action=bust&?ID={$r[']Bust[/url]][[url='jail.php?action=bail&ID={$r[']Bail[/url]]</td></tr>"; } print "</table>"; $h->endpage(); ?>