Jump to content
MakeWebGames

bladewolf2010

Members
  • Posts

    369
  • Joined

  • Last visited

Everything posted by bladewolf2010

  1. I remember you doing paid work for me, turned around and said your not doing coding anymore as you are far better in photoshop or something like that. Now your coding again? Would you please make your mind up? PS: How's your javascript abilities as last time we talked you had no idea nor the interest in learning it?
  2. Ouch, someone just got burned. XD
  3. It's only when I use windows, I'll use notepad++ once in awhile :P those only two I actually like.
  4. Create a table in the DB for records of what you want $q=$db->query("SELECT * FROM records WHERE recid=1",$c); $v=$db->fetch_row($q); $fifteen=$db->num_rows($q); if ($v['rec15']<$fifteen) {$db->query("UPDATE records SET rec15=$fifteen WHERE recid=1",$c);} something link that
  5. Opps, sorry about that. the global line can actually be shorten to global $db,$r;   Sorry about that, dunno what I was thinking on that.
  6. I do if I'm using coda, if I'm using dreamweaver I let it do the indenting itself
  7. Always glad to help the community out here and there. It's where I learned, when I did, was a bit harsher but, meh. It helped me greatly.
  8. I know right, we have to just love the professional staff here, with how they treat us and what not ain't :P Thanks for that little bit of information. :)
  9. That does nothing but the speed diff which is pointless for a game. Why not just make a func? <?php #for the pretty colors function username($userid) { global $db, $ir, $h, $_GET, $_POST, $r; $query = $db->query("SELECT username,user_level,userid,donatordays FROM users WHERE userid = " . $userid); if ($db->num_rows($query)) { $user_data = $db->fetch_row($query); if ($user_data['user_level'] == 2) { $user_data['username'] = "<font color='#gold'>" . $user_data['username'] . "</font></a> [{$r['userid']}] <img src='/images/donator.gif' alt='Donator: {$r['donatordays']} Days Left' title='VIP: {$r['donatordays']} Days Left' />"; } elseif ($user_data['user_level'] == 3) { $user_data['username'] = "<font color='Blue'>" . $user_data['username'] . "</font></a> [{$r['userid']}] <img src='/images/donator.gif' alt='Donator: {$r['donatordays']} Days Left' title='VIP: {$r['donatordays']} Days Left' />"; } elseif ($user_data['user_level'] == 4) { $user_data['username'] = "<font color=' Purple '>" . $user_data['username'] . "</font></a> [{$r['userid']}] <img src='/images/donator.gif' alt='Donator: {$r['donatordays']} Days Left' title='VIP: {$r['donatordays']} Days Left' />"; } elseif ($user_data['donatordays'] > 0) { $user_data['username'] = "<font color='red'>" . $user_data['username'] . "</font></a> [{$r['userid']}] <img src='/images/donator.gif' alt='Donator: {$r['donatordays']} Days Left' title='VIP: {$r['donatordays']} Days Left' />"; } else { $user_data['username'] = "<font color='#fff'>" . $user_data['username'] . "</font> [{$r['userid']}]</a>"; } return $user_data['username']; } else { return false; } } ?>   so for the username be something like this ".username($r['userid'])."   Benefit of this is you can use it numerous amounts of time without having to add the whole array and whatnot to the file itself :)
  10. Lol, it doesn't really, I just felt like being a smart ass hehe. That is like a rainbow tabbing or something :P I dislike doing it that way, I prefer to leave it to the left depending on what I'm using to code with. PS: Don't tab like that lol. Here's your code tabbed propperly well, there is no correct way to tab, it's all personal preference. I'm sure quite a few will disagree with that but meh.   <?php # GTA MOD # FREE MOD FOR MCCODES V2 # CREATED BY STEVE AKA=NEWBIE require_once("globals.php"); switch ($_GET['action']) { case "steal": steal_car(); break; default: gta_default(); break; } function gta_default() { global $db, $ir, $c, $userid, $h; echo "<center><h4><font color=green>GTA.</h4> <h5><i>Want to steal a car well here you can have a chance at doing that.</i></h5></font> <img border='0' src='http://www.unitedrecyclinginc.com/ur/images/stories/robber.png' alt='Robber' width='150' height='150' /> <table width=75% cellspacing=1 class='table'> <tr style='background:gray'> <th>Car Name</th> <th>Picture</th> <th>Sell Value</th> <th>Steal Link</th></tr>"; $c = $db->query("SELECT * FROM gta LEFT JOIN users u ON u.userid=carNAME ORDER BY carID ASC"); while ($r = $db->fetch_row($c)) { $steal_link = "<a href='gta.php?action=steal&ID={$r['carID']}'>Steal The Car</a>"; print "\n<tr> <td>{$r['carNAME']}</td> <td><img border='0' src='{$r['carPIC']}'width='75' height='75' /></td> <td>\${$r['carSVALUE']}</td> <td>[$steal_link]</td></tr>"; } print "</table>"; } function steal_car() { global $db, $ir, $c, $userid, $h; if ($ir['maxGTA'] == 50) { echo "<font color=red>You have done your maximum gta for today please come back tommorow. <a href='index.php'>Go Home</a>"; $h->endpage(); exit; } $c = $db->query("SELECT * FROM gta WHERE carID={$_GET['ID']}"); if (!$db->num_rows($c)) { echo "Invalid Car ID contact ID:[1]. <a href='gta.php'>Back</a>"; $h->endpage(); exit; } $r = $db->fetch_row($c); if ($ir['IQ'] < $r['carIQ']) { echo "<font color=red>You have failed to steal {$r['carNAME']} & been sent to jail for {$r['carPRISON']}"; $db->query("UPDATE users SET jail=jail+{$r['carPRISON']}, jail_reason = 'Failed to steal {$r['carNAME']}', maxGTA=maxGTA+1 WHERE userid=$userid"); $h->endpage(); exit; } else { echo "<font color=green>You managed to steal {$r['carNAME']} & sold it for \${$r['carSVALUE']}.</font>"; $db->query("UPDATE users SET money=money+{$r['carSVALUE']}, maxGTA=maxGTA+1 WHERE userid=$userid"); } } $h->endpage(); ?>
  11. Just for you :) It's indented, hope you enjoy hehe. <?php # GTA MOD # FREE MOD FOR MCCODES V2 # CREATED BY STEVE AKA=NEWBIE require_once("globals.php"); switch ($_GET['action']) { case "steal":steal_car();break; default:gta_default();break; } function gta_default() { global $db, $ir, $c, $userid, $h; echo "<center><h4><font color=green>GTA.</h4> <h5><i>Want to steal a car well here you can have a chance at doing that.</i></h5></font> <img border='0' src='http://www.unitedrecyclinginc.com/ur/images/stories/robber.png' alt='Robber' width='150' height='150' /> <table width=75% cellspacing=1 class='table'> <tr style='background:gray'> <th>Car Name</th> <th>Picture</th> <th>Sell Value</th> <th>Steal Link</th></tr>"; $c = $db->query("SELECT * FROM gta LEFT JOIN users u ON u.userid=carNAME ORDER BY carID ASC"); while ($r = $db->fetch_row($c)) { $steal_link = "<a href='gta.php?action=steal&ID={$r['carID']}'>Steal The Car</a>"; print "\n<tr> <td>{$r['carNAME']}</td> <td><img border='0' src='{$r['carPIC']}'width='75' height='75' /></td> <td>\${$r['carSVALUE']}</td> <td>[$steal_link]</td></tr>"; } print "</table>"; } function steal_car() { global $db, $ir, $c, $userid, $h; if ($ir['maxGTA'] == 50) { echo "<font color=red>You have done your maximum gta for today please come back tommorow. <a href='index.php'>Go Home</a>"; $h->endpage(); exit; } $c = $db->query("SELECT * FROM gta WHERE carID={$_GET['ID']}"); if (!$db->num_rows($c)) { echo "Invalid Car ID contact ID:[1]. <a href='gta.php'>Back</a>"; $h->endpage(); exit; } $r = $db->fetch_row($c); if ($ir['IQ'] < $r['carIQ']) { echo "<font color=red>You have failed to steal {$r['carNAME']} & been sent to jail for {$r['carPRISON']}"; $db->query("UPDATE users SET jail=jail+{$r['carPRISON']}, jail_reason = 'Failed to steal {$r['carNAME']}', maxGTA=maxGTA+1 WHERE userid=$userid"); $h->endpage(); exit; } else { echo "<font color=green>You managed to steal {$r['carNAME']} & sold it for \${$r['carSVALUE']}.</font>"; $db->query("UPDATE users SET money=money+{$r['carSVALUE']}, maxGTA=maxGTA+1 WHERE userid=$userid"); } } $h->endpage(); ?>
  12. I'm curious about doing security via class function. Any idea's on it? <?php class clean { function post($text) { $text = isset($text); $text = mysql_real_escape_string($text); $text = htmlspecialchars($text, ENT_QUOTES); $text = strip_tags($text); return ($text); } } ?>
  13.   I could hug you right now Sniko, This will help me out SO much with my crimes and gang school
  14. Alright, thanks for the idea's. I'm going to go with the DB prefixes. I waited for McCodes Support area for 2 days, still no reply. I have another ticket in there since 4 August 2012, 9:01pm... Are they on vacation again for awhile? It's like when I bought V1 all over again... I actually buy it then poof, they vanish -.-""
  15. Thanks for making it more clear to understand there for me.
  16.   You my friend have just confused me... I understood what DKK was saying, then you said something. That made absolutely no sense to me. :P Sorry, and thanks DJK for that little bit.
  17. Meh it's in the works, I have an almost finished game, and a half finished engine. Going to work on the game then finish the engine for a new game.
  18. Alright, I'll send a support ticket thanks for the quick responses.
  19. I am curious if I need to purchase multiple licenses for my game. It uses a master DB which depending where you decide to go it'll link the master DB with a sub DB for that area. The different Sub DB's are for sub-domains. Would I need a license for each sub domain, or can I use just the one I purchased for the main domain?
  20. -.-" Usually text editors have this nice feature called "Find" which is usually ctrl + F for what I use anyways.
  21. Well, you could delete it from the query, or you could add it into the database.
  22. My game does not use $ for the currency. It uses gold, silver, and copper. 1000 copper = 1 silver 1000 silver = 1 gold Here is my fixed function now. function gold_format($money) { $counter=strlen($money); if ($counter <= 3) { $moneydone="$money<img src='images/money/Copper.png'/>"; return $moneydone; } if ($counter <= 6) { $copper= substr($money, -3); $silver= substr($money, 0, -3); $copper=ltrim($copper, 0); if ($copper != "") { $moneydone="$silver<img src='images/money/Silver.png'/>$copper<img src='images/money/Copper.png'/>"; } else { $moneydone="$silver<img src='images/money/Silver.png'/>"; } return $moneydone; } else { $copper= substr($money, -3); $mid=($counter-6); $silver= substr($money, $mid, -3); $gold=substr($money, 0, $mid); $copper=ltrim($copper, 0); $silver=ltrim($silver, 0); if ($copper != "") { if ($silver != "") { $moneydone="$gold<img src='images/money/Gold.png'/>$silver<img src='images/money/Silver.png'/>$copper<img src='images/money/Copper.png'/>"; } else { $moneydone="$gold<img src='images/money/Gold.png'/>$copper<img src='images/money/Copper.png'/>"; } } else { $moneydone="$gold<img src='images/money/Gold.png'/>"; } return $moneydone; } }
  23. Thanks for the advice, got it to do what I needed it to do using ltrim. :)
  24. Could you explain how is_null is used?
  25. Hey, I have a function that converts my money into gold, silver and copper. (code below) I was wondering if there is a way to make it so if there is 0 copper and\or silver it'd make it not show it. (IE: 200gold 300 silver 000copper make it look like this, 200gold 300 silver) Thanks for the help in advance :) function gold_format($money) { $counter=strlen($money); if ($counter <= 3) { $moneydone=" $money<img src='images/Copper.png'/>"; return $moneydone; } if ($counter <= 6) { $copper= substr($money, -3); $silver= substr($money, 0, -3); $moneydone=" $silver<img src='images/Silver.png'/> $copper<img src='images/Copper.png'/>"; return $moneydone; } else { $copper= substr($money, -3); $mid=($counter-6); $silver= substr($money, $mid, -3); $gold=substr($money, 0, $mid); $moneydone=" $gold<img src='images/Gold.png'/> $silver<img src='images/Silver.png'/> $copper<img src='images/Copper.png'/>"; return $moneydone; } }
×
×
  • Create New...