Jump to content
MakeWebGames

Samurai Legend

Members
  • Posts

    483
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Samurai Legend

  1. My assumptions are the older generation play more of Text Based RPG games whereas, younger generation are playing more of the new gaming techs. The older generation are soon to be gone and will leave the market of text based RPG games more smaller. Please share your thoughts on this matter.
  2. lool.mov
  3. Most of yous know me as the owner of Samurai Assault. I have made decent money from it when I was running it back then. Around £900 - £1,200 a month and yes in British Pounds haha. I want to start it up again however, with a different name as I lost the domains. I am willing to work with someone taking 30% of profit. Requirements - Have an understanding with PHP, HTML, CSS and JavaScript. Knowing how an economy runs. (Will be needed for the in-game economy). As most businesses gain popularity through customer service. Users will need to be handled correctly by staff. (Good customer service skills). Someone who is open minded and will know how to move forward and give users a pleasant experience. There are more requirements however, these four are the main ones Where are we now? At the moment we have a full running system however, there will still need to be tweaks and updates in order to be on our competitors level. The game itself is amazing. With tons of features and with an eye-catchy template. What we need to do now? The system will need to be over-hauled along with buying a domain and hosting. (Which will be covered by me.) If anyone is interested please contact me! No lay lay people please or time-wasters. Potential money to be made!
  4. Post the script where you found the error.
  5. [uSER=70485]G7470[/uSER] - Thank you so much, that really helped. The code below does everything I want I believe :)   ///Battle Ladder Code $bm = $db->query( "SELECT `lad1`.`bmemberLadder`, `lad1`.`bmemberUser`, `lad2`.`bmemberUser` FROM `battle_members` `lad1` JOIN `battle_members` `lad2` ON `lad1`.`bmemberLadder` = `lad2`.`bmemberLadder` WHERE `lad1`.`bmemberUser` = {$_GET['ID']} AND `lad2`.`bmemberUser` = {$userid}"); if ($db->num_rows($bm) > 0) { $score = rand(1, 10); $db->query(" UPDATE `battle_members` SET `bmemberScore` = `bmemberScore` + {$score}, `bmemberWins` = `bmemberWins` + 1 WHERE `bmemberUser` = {$_GET['ID']}"); $db->query(" UPDATE `battle_members` SET `bmemberScore` = `bmemberScore` - {$score}, `bmemberLosses` = `bmemberLosses` + 1 WHERE `bmemberUser` = {$ir['userid']}"); echo "<br/>You have lost {$score} points from the battle ladder."; } ///End
  6. Okay, the code for the attack pages doesn't check if both users are in the same ladder. So I came up with this: $bm = $db->query( "SELECT `bmemberLadder`, `bmemberUser` FROM `battle_members` WHERE `bmemberUser` = {$_GET['ID']} AND `bmemberUser`= {$userid}"); if ($db->num_rows($bm)) { $data = $db->fetch_row($bm); $battleq = $db->query( "SELECT COUNT(`bmemberUser`) FROM `battle_members` WHERE (`bmemberUser` = {$ir['userid']} AND `bmemberUser` = {$_GET['ID']} AND `bmemberLadder` = {$data['bmemberLadder']})"); if ($db->fetch_single($battleq) > 0) { $score = rand(1, 10); $db->query(" UPDATE `battle_members` SET `bmemberScore` = `bmemberScore` - {$score}, `bmemberLosses` = `bmemberLosses` + 1 WHERE `bmemberUser` = {$r['userid']}"); $db->query(" UPDATE `battle_members` SET `bmemberScore` = `bmemberScore` + {$score}, `bmemberWins` = `bmemberWins` + 1 WHERE `bmemberUser` = {$ir['userid']}"); echo "<br/>You have earnt {$score} points for the battle ladder."; } }   When I attack a user from the same ladder. Nothing appears?
  7. [uSER=53425]Magictallguy[/uSER] I still get the error
  8. Anyone...? ^
  9. Okay, the code for the attack pages doesn't check if both users are in the same ladder. So I came up with this: $bm = $db->query( "SELECT `bmemberLadder`, `bmemberUser` FROM `battle_members` WHERE `bmemberUser` = {$_GET['ID']} AND `bmemberUser`= {$userid}"); if ($db->num_rows($bm)) { $data = $db->fetch_row($bm); $battleq = $db->query( "SELECT COUNT(`bmemberUser`) FROM `battle_members` WHERE (`bmemberUser` = {$ir['userid']} AND `bmemberUser` = {$_GET['ID']} AND `bmemberLadder` = {$data['bmemberLadder']})"); if ($db->fetch_single($battleq) > 0) { $score = rand(1, 10); $db->query(" UPDATE `battle_members` SET `bmemberScore` = `bmemberScore` - {$score}, `bmemberLosses` = `bmemberLosses` + 1 WHERE `bmemberUser` = {$r['userid']}"); $db->query(" UPDATE `battle_members` SET `bmemberScore` = `bmemberScore` + {$score}, `bmemberWins` = `bmemberWins` + 1 WHERE `bmemberUser` = {$ir['userid']}"); echo "<br/>You have earnt {$score} points for the battle ladder."; } }   When I attack a user from the same ladder. Nothing appears?
  10. [uSER=53425]Magictallguy[/uSER] - Thank you MTG however, I am still receiving an error: [h=1]Samurai Assault - Critical Error[/h] A critical error has occurred, and page execution has stopped. Below are the details: PHP Warning: fopen(http://s1104.photobucket.com/user/Jo...edia/YWN.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found (2) Action taken: Line executed: /Users/user/code/game/public/global_func.php:1519 Context at error time: Array ( => [params] => Array ( [http] => Array ( [method] => HEAD ) ) [ctx] => Resource id #38 [http_response_header] => Array ( [0] => HTTP/1.1 404 Not Found [1] => Date: Tue, 12 Jul 2016 10:34:50 GMT [2] => Server: Apache [3] => Set-Cookie: PHPSESSID=t6insiehpjfk3pq67miiri5444; path=/; domain=.photobucket.com [4] => Expires: Thu, 19 Nov 1981 08:52:00 GMT [5] => Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [6] => Pragma: no-cache [7] => Set-Cookie: pb_userid=NWYyYWQ5ZGI0YWM5NmZiMGI1YzEwZDk1ZWUwZjllMWUkYToxOntzOjc6InRyYWNraWQiO3M6MjQ6IjE0NjgzMTk2OTAuMzgyMzY2NzYyOTc3MSI7fQ%3D%3D; expires=Sun, 30-Jul-2084 13:48:56 GMT; Max-Age=2147483646; path=/; domain=.photobucket.com [8] => Set-Cookie: pb_mobile=false; expires=Wed, 13-Jul-2016 10:34:50 GMT; Max-Age=86400; path=/; domain=.photobucket.com [9] => Set-Cookie: _sfkcs2_t6insiehpjfk3pq67miiri5444=TQaeWewbBVqOOW%2FKIpVpHzhghsWgEYcj9n%2BK2iVetiEd0OpfQtg%3D; path=/; domain=.photobucket.com [10] => Cache-Control: no-cache [11] => Vary: User-Agent,Accept-Encoding [12] => Connection: close [13] => Content-Type: text/html; charset=utf-8 ) )
  11. I need that switched on, can I not use an IF statement?
  12. Aha, understood. How would I make it not show the error?
  13. [uSER=53425]Magictallguy[/uSER] - Yes indeed, it is your function. You was helping me out remember :P But yeah I can't seem to see the issue why it don't work with Photobucket links?
  14. Hello all, I have an issue which I can not identify the issue why it occurs. Whenever, someone uses an Photobucket link to update their image it gives an error however, using an alternative image host it gives no errors? Error Message -   Samurai Assault - Critical Error   A critical error has occurred, and page execution has stopped. Below are the details:   PHP Warning: fopen( http://s1104.photobucket.com/user/Jordan_Pollard/media/YWN.png): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found (2)     Action taken: Line executed: /home/samurai/public_html/live/public/global_func.php:1519     Context at error time:     Array   (   =>   [params] => Array   (   [http] => Array   (   [method] => HEAD   )   )   [ctx] => Resource id #4   [http_response_header] => Array   (   [0] => HTTP/1.1 404 Not Found   [1] => Date: Tue, 05 Jul 2016 09:30:24 GMT   [2] => Server: Apache   [3] => Set-Cookie: PHPSESSID=lpvp9mkgi8vjen092r0qkeqpj7; path=/; domain=.photobucket.com   [4] => Expires: Thu, 19 Nov 1981 08:52:00 GMT   [5] => Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0   [6] => Pragma: no-cache   [7] => Set-Cookie: pb_userid=ZTI2MzFlMjkyZTdjZDZiODA5NmMyYWMxM2E3ZDg2YTMkYToxOntzOjc6InRyYWNraWQiO3M6MjQ6IjE0Njc3MTEwMjQuMzA4NDk2MTY0OTQwNSI7fQ%3D%3D; expires=Sun, 23-Jul-2084 12:44:30 GMT; Max-Age=2147483646; path=/; domain=.photobucket.com   [8] => Set-Cookie: pb_mobile=false; expires=Wed, 06-Jul-2016 09:30:24 GMT; Max-Age=86400; path=/; domain=.photobucket.com   [9] => Set-Cookie: _sfkcs2_lpvp9mkgi8vjen092r0qkeqpj7=TQaeWewbBVqOOW%2FKIpVpHzhghsWgEYcj9n%2BK2iVetiEd0OpfQtg%3D; path=/; domain=.photobucket.com   [10] => Cache-Control: no-cache   [11] => Vary: User-Agent,Accept-Encoding   [12] => Connection: close   [13] => Content-Type: text/html; charset=utf-8   )   )   global_func.php - function isImage($url) { $url = filter_var($url, FILTER_VALIDATE_URL) ? filter_var($url, FILTER_SANITIZE_URL) : null; if(empty($url)) return false; $params = ['http' => ['method' => 'HEAD']]; $ctx = stream_context_create($params); $fp = fopen($url, 'rb', false, $ctx); if(!$fp) return false; // Problem with url $meta = stream_get_meta_data($fp); if ($meta === false) { fclose($fp); return false; // Problem reading data from url } $wrapper_data = $meta['wrapper_data']; if(is_array($wrapper_data)) foreach(array_keys($wrapper_data) as $hh) if (substr($wrapper_data[$hh], 0, 19) == "Content-Type: image") { fclose($fp); return true; } fclose($fp); return false; } line 1519: $fp = fopen($url, 'rb', false, $ctx);
  15. I attempted to to copy how the ones in the user field coding is to make it update the user_rangers table however, I came across many errors
  16. So my fields are on another table which is called `user_rangers`. When users use a dexterity potions I want their dexterity which is `urDEXTERITY` in `user_rangers` to do whatever I set it as in the staff panel. In the `items` table the the `effect1` is: a:4:{s:4:"stat?;s:11:?urDEXTERITY";s:3:"dir";s:3:"pos";s:8:"inc_type";s:7:"percent";s:10:"inc_amount";i:100;}   <?php define('PAGE_HEADER', 'Use Item'); require('globals.php'); $_GET['ID'] = (isset($_GET['ID']) && is_numeric($_GET['ID'])) ? abs(intval($_GET['ID'])) : ''; $_POST['qty'] = (isset($_POST['qty']) && is_numeric($_POST['qty'])) ? abs(intval($_POST['qty'])) : ''; $tresder = rand(99, 999); if (!empty($_POST['qty']) && !empty($_GET['ID'])) { $id = $db->query( "SELECT `effect1`, `effect2`, `effect3`, `effect1_on`, `effect2_on`, `effect3_on`, `inv_qty`, `itmname`, `inv_itemid`, `itmtype` FROM `inventory` AS `iv` INNER JOIN `items` AS `i` ON `iv`.`inv_itemid` = `i`.`itmid` WHERE `iv`.`inv_id` = {$_GET['ID']} AND `iv`.`inv_userid` = $userid"); if ($db->num_rows($id) == 0) { error('Invalid item ID'); } else { $r = $db->fetch_row($id); if($r['itmname'] == 'Crew Exploder') { if($ir['hospital'] > 0 || $ir['prison'] > 0) { error("This page cannot be accessed while in prison or hospital."); } echo "<h3><u>Crew Exploder</u></h3><hr width=75%> Crew Exploder Instructions:<br /> Enter the ID of a member of the Crew that you wish to use the Crew Exploder on.<br /><br /> Further Information:<br /><br /> 1) 10 - 40 minutes hospital time.<br /> 2) Crew exploders can only be used on members not in hospital or prison.<br /> 3) Hospital time is only issued to members not already in hospital or prison.<br /> 4) Crew exploders can only be used on members of a crew that you are in war with.<br /> 5) Respect is gained at a rate of 3 respect per member hospitalised.<br /> </br> <form action='crew_exploder.php' method='get'> <input type='hidden' name='ID' value='{$_GET['ID']}' /> <input type='hidden' name='tresde' value='$tresder' /> User ID: <input type='text' name='userid' value='' /><br /></br> <input type='submit' value='Initiate' /></form> <hr width = '75%'><a href = 'index.php'>>Go Back</a><hr width = '75%'>"; exit($h->endpage()); } if ($_POST['qty'] > $r['inv_qty']) { error('You are trying to use more than you have!'); } else { if (!$r['effect1_on'] && !$r['effect2_on'] && !$r['effect3_on']) { error('Sorry, this item cannot be used as it has no effect.'); } for ($enum = 1; $enum <= 3; $enum++) { if ($r["effect{$enum}_on"]) { $einfo = unserialize($r["effect{$enum}"]); if ($einfo['inc_type'] == "percent") { if (in_array($einfo['stat'], array('energy', 'mood', 'courage', 'hp'))) { $inc = round( $ir['max' . $einfo['stat']] / 100 * $einfo['inc_amount']) * $_POST['qty']; } else { $inc = round( $ir[$einfo['stat']] / 100 * $einfo['inc_amount']) * $_POST['qty']; } } else { $inc = $einfo['inc_amount'] * $_POST['qty']; } if ($einfo['dir'] == "pos") { if (in_array($einfo['stat'], array('energy', 'mood', 'courage', 'hp'))) { $ir[$einfo['stat']] = min($ir[$einfo['stat']] + $inc, $ir['max' . $einfo['stat']]); } else { $ir[$einfo['stat']] += $inc; } } else { $ir[$einfo['stat']] = max($ir[$einfo['stat']] - $inc, 0); } $upd = $ir[$einfo['stat']]; if (in_array($einfo['stat'], array('strength', 'agility', 'guard', 'labour', 'IQ'))) { $db->query( "UPDATE `userstats` SET `{$einfo['stat']}` = '{$upd}' WHERE `userid` = {$userid}"); } else if (in_array($einfo['stat'], array('urDEXTERITY'))) { $db->query( "UPDATE `user_rangers` SET `{$einfo['stat']}` = '{$upd}' WHERE `userid` = {$userid}"); } else { $db->query( "UPDATE `users` SET `{$einfo['stat']}` = '{$upd}' WHERE `userid` = {$userid}"); } } } $qty = $r['inv_qty'] - $_POST['qty']; item_remove($userid, $r['inv_itemid'], $_POST['qty']); confirmation("<font colot='yellow'>x{$_POST['qty']}</font> {$r['itmname']} used successfully!<br/>You have <font color='yellow'>x{$qty}</font> {$r['itmname']} remaining."); } } } else if (!empty($_GET['ID']) && empty($_POST['qty'])) { $id = $db->query( "SELECT `itmid`, `inv_qty`, `itmname`, `itmtype` FROM `inventory` AS `iv` INNER JOIN `items` AS `it` ON `iv`.`inv_itemid` = `it`.`itmid` WHERE `iv`.`inv_id` = {$_GET['ID']} AND `iv`.`inv_userid` = {$userid} LIMIT 1"); if ($db->num_rows($id) == 0) { error('Invalid item ID'); } else { $itemid = abs((int) $_GET['ID'])+0; $r = $db->fetch_row($id); /*if($r['itmid'] == 7){ echo "<h3><u>Item Use</u></h3> <hr/><b>Enter how many {$r['itmname']} you want to use. You have {$r['inv_qty']} to use.</b> <hr/> <form action='itemuse.php?ID={$_GET['ID']}' method='post'> <input type='hidden' name='verf' /> Quantity: <input type='text' name='qty' value='' /> <br /> <input type='submit' value='Use Items (no prompt so be sure!)' /> </form><hr/><a href = 'index.php'>>Go Back</a><hr/> "; } else*/ if($r['itmtype'] == 1){ echo "<h3><u>Item Use</u></h3><hr width = '75%'><table width='75%' class='table' border='0' cellspacing='1' cellpadding='1'> <tr><th colspan = '3'>Multi Use</th></tr> <tr> <th>Item</th> <th>Qty</th> <th>Use</th> </tr> <tr> <th>{$r['itmname']}</th> <td><font color='yellow'>x{$r['inv_qty']}</font></td> <form action='itemuse.php?ID={$_GET['ID']}' method='post'> <input type='hidden' name='verf' /> <td><input type='text' name='qty' value='' /></td> </tr> <tr><th colspan='3'><input type='submit' value='Use Item' /></th></tr> </form></table><hr width = '75%'> "; } else { echo "<h3><u>Item Use</u></h3> <hr/><b>Are you sure you want to use one ".$r['itmname']."?</b> <hr/> <form action='itemuse.php?ID={$_GET['ID']}' method='post'> <input type='hidden' name='verf' /> <input type='hidden' name='qty' value='1' /> <br /> <input type='submit' value='Use Item' /> </form><hr/><a href = 'index.php'>>Go Back</a><hr/> "; } } $db->free_result($id); } else { error('Invalid use of file.'); } $h->endpage();   I can't seem to get it to work.
  17. [uSER=53425]Magictallguy[/uSER] - So when I click the submit button this is the URL: staff_userlogs.php?user=14 This is what displays on the screen: This script requires an action.
  18. ​[uSER=53425]Magictallguy[/uSER] [uSER=65530]Coly010[/uSER] - Thank you guys for the help!
  19. Since I am using a $_POST method to find the userid, when I head onto the next page I get the error: Invalid user, Please go back and try again. I need something which will make the $_POST carry onto the next page as this is my problem I believe.   function select_user_logs() { global $db, $ir, $sa; echo "Select the user which you want to view their log. <form action='staff_userlogs.php?action=viewlogs' method='post'> User: " . userlogged_dropdown(NULL, 'user') . " <br /> <input type='submit' value='Submit' /> </form>"; } function view_user_logs() { global $db, $ir, $sa; if (!isset($_GET['st'])) { $_GET['st'] = 0; } $st = abs(intval($_GET['st'])); $app = 100; $_POST['user'] = (isset($_POST['user']) && is_numeric($_POST['user'])) ? abs(intval($_POST['user'])) : 0; if (empty($_POST['user'])) { error('Invalid user.'); } $query = $db->query("SELECT COUNT(`uUSERID`) FROM `user_logs` WHERE `uUSERID` = {$_POST['user']}"); $logs = $db->fetch_single($query); $db->free_result($query); if ($logs == 0) { error('There have been no logs yet from this user.'); } $pages = ceil($logs / $app); $q = $db->query(" SELECT `userid` FROM `users` WHERE `userid` = {$_POST['user']}"); if ($db->num_rows($q) == 0) { $db->free_result($q); error('User doesn\'t seem to exist, Please go back and try again.'); } echo "<hr width = '75%'><table width = '75%' cellpadding = '1' cellspacing = '1' class = 'table'> <tr> <th>User</th> <th>Address</th> <th>Time</th> </tr>"; $query = $db->query("SELECT `uID`, `uUSERID`, `uADDRESS`, `uTIME` FROM `user_logs` WHERE `uUSERID` = {$_POST['user']} ORDER BY `uTIME` DESC LIMIT $st, $app"); while ($r = $db->fetch_row($query)) { echo "<tr> <td>" . $sa->username_nonformat($r['uUSERID'], TRUE) . "</td> <td>{$r['uADDRESS']}</td> <td>" . date("F j, Y, g:i:s a", $r['uTIME']) . "</td> </tr>"; } echo"</table><hr width = '75%'> Pages: "; for ($i = 1; $i <= $pages; $i++) { $s = ($i - 1) * $app; echo ($s == $st) ? '<b>' . $i . '</b> ' : '<a href="staff_userlogs.php?action=viewlogs&st=' . $s . '">' . $i . '</a> '; echo ($i % 25 == 0) ? '<br />' : ''; } $mypage = floor($_GET['st'] / 100) + 1; stafflog_add("Viewed " . $sa->username_nonformat($_POST['user'], TRUE) . " user logs. (Page: $mypage)"); }
  20. Put this on top of the page - require_once('jBBCode/Parser.php'); $parser = new jBBCode\Parser; $parser->loadDefaultCodes();   When wrapping it with the code -   " . nl2br($parser->getAsHTML($parser->parse($r['example']))) . "  
  21. I recommend jBBCode! It is easy to install and really secure! If you need help with installing it, I am willing to help.
  22. Sorry this offer is now invalid, just realised the potential the game has. Als sorry for the late reply
  23. <?php require('../globals_nonauth.php'); if(isset($_SESSION['userid']) and !empty($_SESSION['userid'])) { // Get the data and return what is required... $sql = sprintf( "SELECT `level`, `money`, `crystals`, `energy`, `maxenergy`, `will`, `maxwill`, `brave`, `maxbrave`, `hp`, `maxhp`, `new_events`, `new_mail` FROM `users` WHERE `userid` = %u;", $_SESSION['userid'] ); $db->query($sql); if($db->num_rows()) { // fetch the row and construst the return array $user_data = $db->fetch_row(); $user_data['energypercent'] = ($user_data['energy'] / $user_data['maxenergy']) * 100; $user_data['willpercent'] = ($user_data['will'] / $user_data['maxwill']) * 100; $user_data['bravepercent'] = ($user_data['brave'] / $user_data['maxbrave']) * 100; $user_data['hppercent'] = ($user_data['hp'] / $user_data['maxhp']) * 100; // construct the return array including the user data $return = array('success' => true, 'player' => $user_data); } else { // Something wrong with the session, send an error $return = array('success' => false, 'message' => 'You encountered an error'); } } else { // Something wrong with the session, send an error $return = array('success' => false, 'message' => 'There was a problem with the request'); } // Setup JSON headers header('Cache-Control: no-cache, must-revalidate'); header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); header('Content-type: application/json'); // Return the JSON object echo json_encode($return); ?>   [uSER=72582]boionfire81[/uSER] - Try this out
  24. took me 10minutes to find this! But here is exactly what you want :) http://makewebgames.io/forum/game-engines/mccode-development-support/free-modifications/26013-update-vitals-in-template
  25. Thank you so much! Really made me understand :) So if I divide by 10. That will be 10% and if I divide by 4 it will be 25% :) Thanks [MENTION=70485]G7470[/MENTION]​
×
×
  • Create New...