-
Posts
2,210 -
Joined
-
Last visited
-
Days Won
47
Content Type
Profiles
Forums
Events
Everything posted by sniko
-
Glad to hear Vonnie! I hope all goes well for you!
-
Well, as this is mccodes, the field names for you weapons are; equip_primary equip_secondary This is with by default anyway, unsure if you've changed it. Now, to select the weapon power from an item, you would do; <?php /* * Make sure $ir is global'd, if needed. * Show weapon power */ $get = $db->query("SELECT `weapon` FROM `items` WHERE `itmid`={$ir['equip_primary']}"); $r = $db->fetch_row($get); echo "Item Power: {$r['weapon']}"; ?> And that will display your weapon power. Sniko.
-
Why is he so angry? He uses offensive words, and by the word "erm" at the start indicates he is blabbering, as well as the slang /:
-
Ok, I've looked over Oracle's auction files, and here are the things I've found, and fixed. - In the inventory, the _GET ID was the inventory key, not the item id from the inventory table - A query misspelled a column - (I added a filter in the add function)
-
As i said earlier (..and this isn't shouting at you :P) my cron experience comes from McCodes, and if you, for example, go to http://www.a-random-game.com/cron_hour.php?code=code as a user, it still would run. From my experience anyway. Maybe I interpreted your reply wrong, but you were saying that we don't need a ?code as it wouldn't run anyway? I think it would. Or are you saying, something else?
-
What are you trying to do when the message occurs?
-
I'm familiar with cron jobs at a McCodes level. Basically, you need to create a file, which includes queries/content that you want to be executed every x minutes/hours/days/weeks. So, say you want something to be executed every day. First we would create a file, something like; crons/1day_something.php And this is what the content of that file will look like; <?php /* * Establish database connection for database queries * Cron example, 1 day. */ $code = "XXX"; /* Change this code, so only you know it, so a 3rd party cannot manually execute the cron */ if(!$_GET['code'] OR $_GET['code'] != $code) { exit; /* The script will not continue */ } $message = "This\nEmail\nWill\nSend\nEvery\nDay"; $message = wordwrap($message, 70); $get = mysql_query("SELECT `email` FROM `user_accounts` WHERE `email`!="""); while($r = mysql_fetch_array($get)) { mail("{$r['email']}", "5 Day email", $message); } ?> Now we have the file, let's set up the cron. Now, this will execute the file crons/1day_something.php every day, automatically. ~sniko
-
Maybe view this site for a guide on how to.
-
I would say that is personal views, as time is money. Depending on how big the modification is (a whole gang system; 4 files (1000+ lines long), 3 file edits) would take some time....
-
Gameplay may be similar, as that is the 'genre' of engine that has been created... To find out whether or not it is in fact McCodes, you need to view the source code.
-
Granted they are used. But, it's only a variable name.... Not complete evidence that this is McCodes. The style looks like McCodes, but, doesn't mean the actual source code is. It could be a style that the author(s) have adopted as it is quite basic, or something that the author(s) like. Possibly, to stop confusion or people pointing fingers at a so called 'copycat', the author(s) could get someone to review the source to validate that it is not McCodes. Another thing, $h could mean header, as it is the header/footer class $r could mean result Just some variables names which have been used, which, like stated before, doesn't mean it is McCodes. It could just be a practice thing to use. $ir could mean my (I) result
-
to AND use_up_some_characters_so_i_can_post
-
How about; - TAX introduced on; - Depositing - Sending money to one another - Housing - Depending on the persons wealth, in-game items cost more
-
[stupid mode] I can't view the video, it says it doesn't exist [/stupid mode] I actually don't think it looks 'low budget' as well, not sure why, It's just my opinion. Nice Work!
-
How ironic, having the ID 666 :P
-
By doing....
-
I think Danny696 did make a better installation file for mccodes. I am going on memory, which may serve me incorrectly. Any who, gurpreet hit the nail on the head :)
-
pre-register.php <?php /* * Do the connection to the database * Execute this SQL via phpmyadmin -- -- Table structure for table `pre_regs` -- CREATE TABLE IF NOT EXISTS `pre_regs` ( `id` int(5) NOT NULL AUTO_INCREMENT, `ip` varchar(15) NOT NULL, `email` varchar(50) NOT NULL, `username` varchar(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ALTER TABLE `pre_regs` ADD `pass` VARCHAR( 25 ) NOT NULL; * Upload this script */ $gamename = 'change_this_value'; echo "<h3>Pre Register</h3>"; $alreadyExists = mysql_query("SELECT `ip` FROM `pre_regs` WHERE `ip`='{$_SERVER['REMOTE_ADDR']}'"); if(mysql_num_rows($alreadyExists)) { echo "<i>You have already pre-registered</i>"; exit(); /* Add your footer in the command, maybe $h->endpage() if using mccodes */ } if(isset($_POST)) { $user = filter_var($_POST['user'], FILTER_VALIDATE_STRING) ? mysql_real_escape_string(strip_tags($_POST['user'])) : NULL; $email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL) ? $_POST['email'] : NULL; if(!$user OR !$email) { echo "Invalid entries..."; } $emailExists = mysql_query("SELECT `id` FROM `pre_regs` WHERE `email`='{$email}'"); elseif(mysql_num_rows($emailExists)) { echo "Email exists..."; } $userExists = mysql_query("SELECT `id` FROM `pre_regs` WHERE `username`='{$user}'"); elseif(mysql_num_rows($userExists)) { echo "Username exists..."; } elseif(strlen($user) < 3) { echo "Username needs to be longer than 3 characters..."; } else { echo "You have pre-registered. Check your e-mail."; $password = genRandomString(); mysql_query("INSERT INTO `pre_regs` (`ip`,`email`,`username`,`pass`) VALUES ('{$_SERVER['REMOTE_ADDR']}', '{$email}', '{$user}', '$password')"); $message = "Your pre-register details to {$gamename}\n Username: {$user}\n Password: {$password}\n Thank you for your pre-register."; $message = wordwrap($message, 70); mail('{$email}', 'Pre Register: {$gamename}', $message); } } echo "<form action='' method='post'> Username: <input type='text' name='user' length='7' maxlength='15' /> <br /> Email: <input type='text' name='email' length='7' maxlength='50' /> <br /> <input type='submit' value='Pre Register' /> </form>"; function genRandomString() { /* Source: http://www.lost-in-code.com/programming/php-code/php-random-string-with-numbers-and-letters/ */ $length = 10; $characters = ’0123456789abcdefghijklmnopqrstuvwxyz’; $string = ”; for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } return $string; } ?> That was rushed.... No style added, just plain text. Staff File <?php include_once('sglobals.php'); if($ir['user_level'] < 2) { echo "403."; exit($h->endpage()); } echo "<h3>Importing Pre-Register</h3>"; if($_POST) { $get = $db->query("SELECT * FROM `pre_regs` ORDER BY `id` ASC"); while($r = $db->fetch_row($get)) { $db->query("INSERT INTO `users` (`username`,`userpass`,`level`,`email`,`login_name`) VALUES ('{$r['username']}', '".md5($r['pass'])."', 1, '{$r['email']}', '{$r['username']}')"); $message = "Your pre-register details to {$set['game_name']}\n Username: {$user}\n Password: {$password}\n WE HAVE OPENED."; $message = wordwrap($message, 70); mail('{$r['email']}', 'Game Open: {$set['game_name']}', $message); } } } else { echo "<form action='' method='post'> <input type='submit' value='OPEN THE GAME' /> </form>"; exit($h->endpage()); } ?> Now, open up your database > users > structure > check all > change > edit all the defaults to what ever :) Note I haven't tested the script, but PM me if there are any issues. -sniko
-
Hey, It could have something to do with you using _SESSION['userid']. As this is in cron_day, and no session has been started (session_start()) it would make _SESSION['userid']=null. This would then cause the error; So, I would advise you collect the userid's from some criteria before hand, and run the rest of the code in an iterative loop. Hope this helps, -sniko
-
I've also noticed, if you have white-space at the top of the file, it will throw this error
-
I watched the video, and i actually think, if all goes to plan, you will have a good simulator/game and I think it will grow a friendly user-base. Keep at it!
-
mccode-v2 Upgrade IPFINDER original Script by Magicaltallguy
sniko replied to Uridium's topic in Free Modifications
Replace with; $ipcheck = sprintf("SELECT * FROM ipfinder WHERE (ip = '%s')", $z['lastip']); $doipcheck = mysql_query($ipcheck) or die(mysql_error()); $ip = mysql_fetch_array($doipcheck); It will tell you more on the error, therefore, you will be able to fix it. If, after doing that, and you have trouble, either PM me or reply. -
Hey fuzzyDCR, The gang system is still in development as my summer has been quite busy, and i hope to finish the system quite soon, but please be patient as i've just gone back to college. Thank you -sniko
-
I've used the MWG IRC twice, maybe three times, only because I prefer skype and msn. Although, when I used it, I didn't know about commands that you could use, maybe some users will remember that :p
-
Bidding for Sethanor [PM me for contact details] Bid: $10. * Bidding for him as he is having log-in issues.