Jump to content
MakeWebGames

Seker

Members
  • Posts

    579
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Seker

  1. Well, now, that is between myself and Ivanna. :D
  2. Incorrect. *All* I did was a "Color To Alpha" in GIMP. Normally works just fine. If it didn't this time, oh well. Was just trying to help.
  3. You'd be amazed at how many times I get asked that. :P I guess I should suck it up and sit through one of the downloads. Will hit you you up a bit later.
  4. It should be. I think it just doesn't show up right in the forums. I've never had any problems with transparency using PNG's before.
  5. Simple Color To Alpha with GIMP. [ATTACH=CONFIG]516[/ATTACH]
  6. I look at the conversions as a good learning tool. Plus, I know people will want it done, anyway, so might as well take an extra few minutes.
  7. And here's V2! Same various instructions as before. attackladder.php: <?php /****************************************/ /********** Attack Ladder V1.0 **********/ /*********** Created By Seker ***********/ /****************************************/ require_once('globals.php'); $ladder = $db->query("SELECT `userid`,`username`,`datotal` FROM `users` WHERE `datotal`>0 ORDER BY `datotal` DESC,`userid` ASC LIMIT 15"); echo " <h3 align='center'>Attack Ladder</h3> <hr width='50%' align='center'> <table width='30%' align='center' border='2'> <tr style='background:#000000'> <th>Pos</th> <th>User</th> <th>Attacks</th> </tr>"; $p = 0; while ($l = $db->fetch_row($ladder)) { $total = number_format($l['datotal']); $p++; if ($l['userid'] == $userid) { $t = "<b><font color='yellow'>"; $et = "</font></b>"; } else { $t = ""; $et = ""; } echo " <tr> <td align='center' width='10%'> $t$p$et </td> <td align='center' width='60%'> $t<a href='viewuser.php?u={$l['userid']}'>{$l['username']} [{$l['userid']}]</a>$et </td> <td align='center' width='30%'> $t{$total}$et </td> </tr>"; } echo " </table> <hr width='50%' align='center'>"; $h->endpage();   ladder_cron.php: <?php /****************************************/ /********** Attack Ladder V1.0 **********/ /*********** Created By Seker ***********/ /****************************************/ require_once('globals_nonauth.php'); $ladder = $db->query("SELECT `userid`,`datotal` FROM `users` WHERE `datotal`>0 ORDER BY `datotal` DESC,`userid` ASC LIMIT 15"); $p = 0; while ($l = $db->fetch_row($ladder)) { $p++; if (!$p) { exit; } if ($p == 1) { $amt = 65; $event = "You have received $amt Crystals for being number one on the Attack Ladder!"; } if ($p > 1) { $amt = 50; $event = "You have received $amt Crystals for being on the Attack Ladder!"; } $db->query("UPDATE `users` SET `crystals`=`crystals`+$amt WHERE `userid`={$l['userid']}"); event_add($l['userid'], "$event", $c); }   Add to your attack files: $db->query("UPDATE users SET datotal=datotal+1 WHERE userid=$userid");
  8. This mod is a small one, though significant for me. The idea of an attack ladder, to me, should be based off attacks. I never was very happy with the "attack who's on it and take their place" thing. This way, it's not based on stats at all. It's purely based on how many attacks the players do in a (day/week/month, etc.) So, here we go. First off, the SQL: ALTER TABLE `users` ADD `datotal` INT( 11 ) NOT NULL default '0';   attackladder.php: <?php /****************************************/ /********** Attack Ladder V1.0 **********/ /*********** Created By Seker ***********/ /****************************************/ session_start(); require "global_func.php"; if ($_SESSION['loggedin'] == 0) { header("Location: login.php"); exit; } $userid = $_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is = mysql_query( "SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid", $c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); $ladder = mysql_query("SELECT `userid`,`username`,`datotal` FROM `users` WHERE `datotal`>0 ORDER BY `datotal` DESC,`userid` ASC LIMIT 15", $c); echo " <h3 align='center'>Attack Ladder</h3> <hr width='50%' align='center'> <table width='30%' align='center' border='2'> <tr style='background:#000000'> <th>Pos</th> <th>User</th> <th>Attacks</th> </tr>"; $p = 0; while ($l = mysql_fetch_array($ladder)) { $total = number_format($l['datotal']); $p++; if ($l['userid'] == $userid) { $t = "<b><font color='yellow'>"; $et = "</font></b>"; } else { $t = ""; $et = ""; } echo " <tr> <td align='center' width='10%'> $t$p$et </td> <td align='center' width='60%'> $t<a href='viewuser.php?u={$l['userid']}'>{$l['username']} [{$l['userid']}]</a>$et </td> <td align='center' width='30%'> $t{$total}$et </td> </tr>"; } echo " </table> <hr width='50%' align='center'>"; $h->endpage();   ladder_cron: (Set this to run however often you need in your cron jobs. I do ever hour. Also, make sure to add in your own cron code stuff.) <?php /****************************************/ /********** Attack Ladder V1.0 **********/ /*********** Created By Seker ***********/ /****************************************/ require_once(dirname(__FILE__) . "/../mysql.php"); require_once(dirname(__FILE__) . "/../global_func.php"); $ladder = mysql_query("SELECT `userid`,`datotal` FROM `users` WHERE `datotal`>0 ORDER BY `datotal` DESC,`userid` ASC LIMIT 15", $c); $p = 0; while ($l = mysql_fetch_array($ladder)) { $p++; if (!$p) { exit; } if ($p == 1) { $amt = 65; $event = "You have received $amt Crystals for being number one on the Attack Ladder!"; } if ($p > 1) { $amt = 50; $event = "You have received $amt Crystals for being on the Attack Ladder!"; } mysql_query("UPDATE `users` SET `crystals`=`crystals`+$amt WHERE `userid`={$l['userid']}", $c); event_add($l['userid'], "$event", $c); }   Just add this to your mainmenu.php: <a href='attackladder.php'>Attack Ladder</a>   And, in any of your attacking files (attackhosp, attackmug, etc.) add this wherever your queries are: mysql_query("UPDATE users SET datotal=datotal+1 WHERE userid=$userid", $c);   As usual, I hope someone finds some use for this. Enjoy!
  9. Not too sure how you got the game up without the install working, but to add the crons, you have to go to your cPanel and then Cron Jobs and input them, manually. It's like that even if your install was working. If you need the crons, just look in the install file.
  10. Just realized I had kept this check in there (Was using it for testing purposes): if ($ir['userid'] == 1) { $success = 68; } else { $success = mt_rand(1,100); }   Fixed it in both versions.
  11. I could be mistaken, but for listing the top three, you could maybe do something like this: $tsele = mysql_query("SELECT COUNT(rankpoints) AS cnt FROM users WHERE status='Alive'"); $tsel = mysql_fetch_array($tsele); echo "{$tsel['1']}"; echo "{$tsel['2']}"; etc, etc.   I could be way off track here, but it's a thought.
  12. I'm just happy someone can use it. I've always been a firm believer in the power of the community. If we weren't all around to help each other, I don't think anyone would ever really complete anything. I don't care how good some is. We all run into problems, eventually. Hoping to put out some more free mods like this one. It's a nice challenge for me to see if I can really put what's in my head into practice. And, when I do, I see no need not to share it with the community.
  13. Okay, the forum seems to have added all the SPAN CLASS mess into my code, so here are the two files (V1 and V2) if you don't feel like removing all of it. I've just used zips that contain the simple install instructions. Easier than renaming files and such. Enjoy! [ATTACH]511[/ATTACH] [ATTACH]512[/ATTACH] Assassination V1.zip Assassination V2.zip
  14. So, I never really was a fan of people charging for assassination mods. Just seems like something everyone has a right to. So, I sat down and created this one. Shout-out to newttster for the impromptu brain-storming which led to me figuring out how to select a random user. Anywho, here's what it does: --- Allows users to attempt an assassination on others --- Cost is currently set to (assassinate-ee)'s level * 10 (As in, if you're trying to assassinate a level 5 user, it would cost 50 crystals) as well as half the (assassinator)'s maximum brave --- 30% chance of success --- 60% chance of the assassin coming back and sending the assassinator to the hospital instead --- 10% chance of missing and hitting a random other user assassination.php (V1): <?php /****************************************/ /********** Assassination V1.0 **********/ /*********** Created By Seker ***********/ /****************************************/ session_start(); require "global_func.php"; if ($_SESSION['loggedin'] == 0) { header("Location: login.php"); exit; } $userid = $_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is = mysql_query( "SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid", $c) or die(mysql_error()); $ir = mysql_fetch_array($is); check_level(); $fm = money_formatter($ir['money']); $cm = money_formatter($ir['crystals'], ''); $lv = date('F j, Y, g:i a', $ir['laston']); $h->userdata($ir, $lv, $fm, $cm); $h->menuarea(); $_GET['ID'] = abs((INT)$_GET['ID']); $ThemData = mysql_query("SELECT * FROM users WHERE userid={$_GET['ID']}", $c); $them = mysql_fetch_array($ThemData); $link = "assassination.php"; $back = "viewuser.php?u={$_GET['ID']}"; $costs = $them['level'] * 10; $cost = number_format($costs); if (mysql_num_rows($ThemData) == 0) { echo " Invalid User!<br /> <a href='index.php'>[back]</a>"; exit($h->endpage()); } if (!$_GET['ID']) { echo " You must choose a user to assassinate!<br /> <a href='index.php'>[back]</a>"; exit($h->endpage()); } if ($_GET['ID'] == $userid) { echo " You cannot assassinate yourself!<br /> <a href='index.php'>[back]</a>"; exit($h->endpage()); } if ($ir['hospital'] || $ir['jail']) { echo " You cannot be here while in jail or the hospital!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } if ($ir['hp'] <= 1) { echo " You are too weak!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } if ($them['hospital'] || $them['jail']) { echo " This user is already in the hospital or jail!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } if ($them['hp'] <= 1) { echo " This user is too weak!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } $_GET['action'] = mysql_real_escape_string( htmlentities(stripslashes($_GET['action']), ENT_QUOTES, 'ISO-8859-1')); switch ($_GET['action']) { case 'confirm': do_assassinate(); break; default: assassinate(); break; } function assassinate() { global $h, $c, $them, $link, $back, $ir, $userid, $cost; echo " Are you sure you want to assassinate {$them['username']}?<br /> It will cost you {$cost} crystals and 50% of your maximum brave.<br /> Be careful! Assassins aren't always as reliable as they should be!<br /> <a href='$link?action=confirm&ID={$_GET['ID']}'>[Yes]</a> - <a href='$back'>[No]</a>"; } function do_assassinate() { global $h, $c, $ir, $userid, $costs, $them, $link, $back; $_GET['ID'] = abs((INT)$_GET['ID']); $bcost = $ir['maxbrave'] / 2; $success = mt_rand(1,100); if ($ir['crystals'] < $costs) { echo " You do not have enough crystals!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } if ($ir['brave'] < $bcost) { echo " You do not have enough brave!<br /> <a href='crystaltemple.php'>[Refill Brave]</a><br /> <a href='$back'>[Go Back]</a>"; exit($h->endpage()); } if ($success <= 60) { mysql_query("UPDATE users SET crystals=crystals-$costs,brave=brave-$bcost,hospital=12,hospreason='Failed Assassination' WHERE userid=$userid", $c); mysql_query("UPDATE users SET brave=0 WHERE userid=$userid AND brave<0", $c); event_add($_GET['ID'], "{$ir['username']} tried to assassinate you and failed!", $c); echo " Your assassin received a better offer! He took you out instead!<br /> You've been put in the hospital for 12 minutes!<br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } elseif (($success >= 61) && ($success <= 70)) { $randusers = mysql_query("SELECT userid,username,hp,hospital,jail FROM users WHERE userid!=$userid AND hospital=0 AND jail=0 ORDER BY RAND() LIMIT 1", $c); $randuser = mysql_fetch_array($randusers); mysql_query("UPDATE users SET crystals=crystals-$costs,brave=brave-$bcost WHERE userid=$userid", $c); mysql_query("UPDATE users SET brave=0 WHERE userid=$userid AND brave<0", $c); mysql_query("UPDATE users SET hospital=10,hospreason='Assassinated',hp=1 WHERE userid={$randuser['userid']}", $c); event_add($randuser['userid'],"You have been assassinated and sent to the hospital for 10 minutes!",$c); echo " Your assassin missed his mark and hit someone else!<br /> <a href='$back'>[Go Back]</a>"; exit($h->endpage()); } elseif ($success >= 71) { mysql_query("UPDATE users SET crystals=crystals-$costs,brave=brave-$bcost WHERE userid=$userid", $c); mysql_query("UPDATE users SET brave=0 WHERE userid=$userid AND brave<0", $c); mysql_query("UPDATE users SET hospital=10,hospreason='Assassinated',hp=1 WHERE userid={$_GET['ID']}", $c); event_add($_GET['ID'], "You were assassinated and put in the hospital for 10 minutes!", $c); echo " You have successfully assassinated {$them['username']}!<br /> <a href='$back'>[Go Back]</a><br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } } $h->endpage();   Then just add this somewhere in viewuser.php: <a href='assassination.php?action=assassinate&ID={$r['userid']}'>[Assassinate]</a>   And here's V2 (Viewuser part is the same): <?php /****************************************/ /********** Assassination V1.0 **********/ /*********** Created By Seker ***********/ /****************************************/ include "globals.php"; $_GET['ID'] = abs((INT)$_GET['ID']); $ThemData = $db->_query("SELECT * FROM users WHERE userid={$_GET['ID']}"); $them = $db->fetch_row($ThemData); $link = "assassination.php"; $back = "viewuser.php?u={$_GET['ID']}"; $costs = $them['level'] * 10; $cost = number_format($costs); if ($db->_num_rows($ThemData) == 0) { echo " Invalid User!<br /> <a href='index.php'>[back]</a>"; exit($h->endpage()); } if (!$_GET['ID']) { echo " You must choose a user to assassinate!<br /> <a href='index.php'>[back]</a>"; exit($h->endpage()); } if ($_GET['ID'] == $userid) { echo " You cannot assassinate yourself!<br /> <a href='index.php'>[back]</a>"; exit($h->endpage()); } if ($ir['hospital'] || $ir['jail']) { echo " You cannot be here while in jail or the hospital!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } if ($ir['hp'] <= 1) { echo " You are too weak!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } if ($them['hospital'] || $them['jail']) { echo " This user is already in the hospital or jail!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } if ($them['hp'] <= 1) { echo " This user is too weak!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } $_GET['action'] = $db->escape( htmlentities(stripslashes($_GET['action']), ENT_QUOTES, 'ISO-8859-1')); switch ($_GET['action']) { case 'confirm': do_assassinate(); break; default: assassinate(); break; } function assassinate() { global $h, $them, $link, $back, $ir, $useridost; echo " Are you sure you want to assassinate {$them['username']}?<br /> It will cost you {$cost} crystals and 50% of your maximum brave.<br /> Be careful! Assassins aren't always as reliable as they should be!<br /> <a href='$link?action=confirm&ID={$_GET['ID']}'>[Yes]</a> - <a href='$back'>[No]</a>"; } function do_assassinate() { global $h, $ir, $useridosts, $them, $link, $back; $_GET['ID'] = abs((INT)$_GET['ID']); $bcost = $ir['maxbrave'] / 2; $success = mt_rand(1,100); if ($ir['crystals'] < $costs) { echo " You do not have enough crystals!<br /> <a href='$back'>[back]</a>"; exit($h->endpage()); } if ($ir['brave'] < $bcost) { echo " You do not have enough brave!<br /> <a href='crystaltemple.php'>[Refill Brave]</a><br /> <a href='$back'>[Go Back]</a>"; exit($h->endpage()); } if ($success <= 60) { $db->_query("UPDATE users SET crystals=crystals-$costs,brave=brave-$bcost,hospital=12,hospreason='Failed Assassination' WHERE userid=$userid"); $db->_query("UPDATE users SET brave=0 WHERE userid=$userid AND brave<0"); event_add($_GET['ID'], "{$ir['username']} tried to assassinate you and failed!"); echo " Your assassin received a better offer! He took you out instead!<br /> You've been put in the hospital for 12 minutes!<br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } elseif (($success >= 61) && ($success <= 70)) { $randusers = $db->_query("SELECT userid,username,hp,hospital,jail FROM users WHERE userid!=$userid AND hospital=0 AND jail=0 ORDER BY RAND() LIMIT 1"); $randuser = $db->fetch_row($randusers); $db->_query("UPDATE users SET crystals=crystals-$costs,brave=brave-$bcost WHERE userid=$userid"); $db->_query("UPDATE users SET brave=0 WHERE userid=$userid AND brave<0"); $db->_query("UPDATE users SET hospital=10,hospreason='Assassinated',hp=1 WHERE userid={$randuser['userid']}"); event_add($randuser['userid'],"You have been assassinated and sent to the hospital for 10 minutes!",$c); echo " Your assassin missed his mark and hit someone else!<br /> <a href='$back'>[Go Back]</a>"; exit($h->endpage()); } elseif ($success >= 71) { $db->_query("UPDATE users SET crystals=crystals-$costs,brave=brave-$bcost WHERE userid=$userid"); $db->_query("UPDATE users SET brave=0 WHERE userid=$userid AND brave<0"); $db->_query("UPDATE users SET hospital=10,hospreason='Assassinated',hp=1 WHERE userid={$_GET['ID']}"); event_add($_GET['ID'], "You were assassinated and put in the hospital for 10 minutes!"); echo " You have successfully assassinated {$them['username']}!<br /> <a href='$back'>[Go Back]</a><br /> <a href='index.php'>[Home]</a>"; exit($h->endpage()); } } $h->endpage();   Hope everyone can use it. Enjoy!
  15. Exactly what I meant. A lot of the times, I'll figure out how to do something previously unknown while working on something entirely different, so I will then go back and fix whatever needed fixing. I'm sure some do see it as jumping all over the place, but I'd rather stay productive with other aspects than get stuck on the same problem for several days.
  16. I think I work in clumps. I know what my end-goal is. Getting there is a bit of a hop-scotch journey, though. About the only "order" I plan is the very first thing I work on. Generally speaking, this usually isn't the layout for me. I like to go in and fix any of the obvious issues (For this example, MCCodes) before I start adding anything. I prefer to start with the internal aspects first. I feel like a look means nothing if nothing works, so I always save that for last. But, as far as my general working process, I just kind of jump around to things as I notice them. Kind of takes the monotony out of it for me.
  17. The ORDER BY statement should look something like this: $tsel = mysql_query("SELECT * FROM users WHERE status='alive' ORDER BY rankpoints ASC,userid DESC LIMIT 10");[php] I believe something like that should work. And then, I think your table is right, but you just need to add a <td>$top['rankpoints']</td> in there. I think.
  18. Hey, I was noticed! I must be infiltrating the popular kids! Really though, lists like these are always great. It's hard to separate who's willing to do what and when for some people. Great job!
  19. I'll definitely work with everything and see what works best for me. Appreciate the tips.
  20. Well, I'm not actually calling it a brothel. Though, I guess that'd be as easy as just tweaking some things. The reason I was leaning toward the function is because then I could use it anywhere. Places like crystal temple, hunting, etc. Anywhere I wouldn't want refreshing.
  21. I'm currently creating an alternative to the brothels floating around here. What I'm trying to do with it right now is make it so it generates a random session ID/token at the end of the url to prevent refreshing/botting, etc. While perusing some tutorial sites, I found this function. My question is, will this work? And is the example usage I posted correct? genToken: function genToken( $len = 32, $md5 = true ) { # Seed random number generator # Only needed for PHP versions prior to 4.2 mt_srand( (double)microtime()*1000000 ); # Array of characters, adjust as desired $chars = array( 'Q', '@', '8', 'y', '%', '^', '5', 'Z', '(', 'G', '_', 'O', '`', 'S', '-', 'N', '<', 'D', '{', '}', '[', ']', 'h', ';', 'W', '.', '/', '|', ':', '1', 'E', 'L', '4', '&', '6', '7', '#', '9', 'a', 'A', 'b', 'B', '~', 'C', 'd', '>', 'e', '2', 'f', 'P', 'g', ')', '?', 'H', 'i', 'X', 'U', 'J', 'k', 'r', 'l', '3', 't', 'M', 'n', '=', 'o', '+', 'p', 'F', 'q', '!', 'K', 'R', 's', 'c', 'm', 'T', 'v', 'j', 'u', 'V', 'w', ',', 'x', 'I', '$', 'Y', 'z', '*' ); # Array indice friendly number of chars; empty token string $numChars = count($chars) - 1; $token = ''; # Create random token at the specified length for ( $i=0; $i<$len; $i++ ) $token .= $chars[ mt_rand(0, $numChars) ]; # Should token be run through md5? if ( $md5 ) { # Number of 32 char chunks $chunks = ceil( strlen($token) / 32 ); $md5token = ''; # Run each chunk through md5 for ( $i=1; $i<=$chunks; $i++ ) $md5token .= md5( substr($token, $i * 32 - 32, 32) ); # Trim the token $token = substr($md5token, 0, $len); } return $token; }   example usage: $randok = genToken(); <a href='example.php?ID={$randtok}'>Example</a>   To better explain, what I'm looking for is a URL that would then look like this: http://example.com/example.php?ID=aahkf$%dhkjsh$   And, when refreshed would throw an error. But, when you go back to the link and click it again, it should generate a new random token at the end. Am I making sense?
  22. Hey, copywriting is no joke. I'm still struggling over a little paragraph description. :P Design is pretty sick, though.
  23. I would generally agree, but "Road To Perdition" as a game? Could be a winner. :P
  24. I'm still all about the IPN. Especially if someone can get it working with Cronus's Donation Mod. :D
  25. Appreciate you getting it to work. Hadn't had time to re-do it, yet. Will update the original post and make sure there's a "Fixed By" credit in there. :)
×
×
  • Create New...