
Floydian
Members-
Posts
900 -
Joined
-
Last visited
Never
Content Type
Profiles
Forums
Events
Everything posted by Floydian
-
Re: MCCODESV2 io have an error I don't run an mccodes v2 game though. ;) I don't even run an mccodes v1 game. I do use mccodes lite on PHP Horizons web site. So, what's your point Hanif?
-
Re: MCCODESV2 io have an error There are a number of posts about this very issue. Since you paid $300 for version 2 of mccodes, shouldn't the person that sold you the script be helping you with installation problems?
-
Re: main page/login Keep us posted, Omega, on how that works out ;)
-
Re: Max Level You're welcome. ;) And I forgot to mention that the code you posted does indeed look like it will top off leveling at level 100 ;) if($ir['exp'] >= $ir['exp_needed'] && $ir['level'] < 100) { As for the experience, I'm not sure that would matter once you can't gain any levels. As for the question of limiting money, I'm not sure players would be very happy when they find out they have maxed out. You're best bet is to reduce the amount of money people are getting from crimes and whatnot.
-
Re: Max Level The point Pheonix, is once you get to the point that you gain level 101, interesting things happen. If your proposed fix comes before the checklevel function, then it goes like this: The first page load after gaining the new level, your level is set to 100, and then the check level sees that you have enough exp to gain level 101, and you get the boost, like health + 20, and so on. Then on the next page load, your "fix" takes you back to level 100. And then you gain, then you lose, then you gain, then you lose. But, each time, you keep the health boost, and all that. If your fix comes after check level. It's basically the same thing, but in a different order. See the problem?
-
Re: Max Level That last suggestion isn't going to be helpful. You have to modifiy the check_level() function. What Pheonix suggested would cause unintended consequences.
-
Re: [Request]Business Mod With all due respect, this is a copy, verbatim, of Torn Cities companies. What's special about that? Here's the deal folks: when someone comes to me with a unique original idea of their own, I do not sell that script to other folks. Period. Just ask Noelle. I've made tons of fantastic scripts for her a battleship (just like the board game) mod, a real time russian roullet parlor, and more things that were not based on any other game. When I'm asked to copy xxxx game's xxxxx mod, well, sorry to say, but that's not your idea we're working with there. It's Torn Cities in this case.
-
Re: [mccode v2] inventory.php If you look over my posts, you'll see I help a lot of folks around here. However, you're going to have to do some things in your database for this one to work properly, and without seeing the script, making sense of it, and going over a bunch of things with you, it wouldn't be possible for me to help you here. And like I said, this is beyond the scope (for me) of free support. No offense should be taken. If I had ignored your post, after having posted here once, perhaps that would be an offense, but that's were we stand.
-
Re: [mccode v2] inventory.php The reason I asked is two fold. The main reason is that it looks like from where this topic was going, that there was going to be a long drawn out sequence of me suggesting something for you to try. Then, when you did that, another thing crops up, and you want another suggestion. Eventually, the script might get finished, but not without having made a bunch of back and forth posts which, quite frankly, that level of support is something I'm not willing to do for free. I do, and others on this forum do as well, offer our services for hire. Secondly, I didn't just want to say: "It looks like you don't know much about php and mysql. You need to learn the basics first, and then attempt to work on a game.", without asking you first if you had these skills. Now I know you don't have these skills, and I can say that without assuming anything ;) If I may draw an a-n-a-l-ogy (a n a l got censored...): Most people don't take things they know almost nothing about apart and try to fix them. I.e., cars, tvs, computers, and so on. And if they did, and they couldn't solve the problem, seeking free support about how to put together a transmission when you know very little, if nothing at all, about a transmission, is likely to end up with to results: The person helping you does all the work. The person helping you decides you're not qualified to attempt such vast repairs at this time and instructs you to seek professional help, or study up some more. Anyways, back to your question: "where is this field list? and maybe both errors are related as i forgot to change something." You don't know where the "field list" is. That would require explaining how to work your database. This is a rather large subject, and there's little chance of you reading my treatise on it when there's tons of info about databases on the net. It should suffice to say, your problem is a lot bigger than just editing one line of code. I'm looking at some fundamental problems with how that script is worked up, and is definitely beyond the scope of free help. That is basically what mdshare meant, I think, although said far more concisely. ;)
-
Re: [mccode v2] inventory.php Are you a programmer?
-
Re: [mccode v2] inventory.php do something like this: if (!isset($ir['equip_blank']) or strlen( (string) $ir['equip_blank']) < 1) { $ir['equip_blank'] = 0; } put that before your query. At least the var will be initialized.
-
HTML CSS Grids based layout (multi-column fluid pages)
Floydian replied to Floydian's topic in HTML/XHTML/CSS
Re: HTML CSS Grids based layout (Add a dynamic menu) To continue the example, why not take the left hand vertical menu and add some affects to it. Here's a link to the file: http://www.phphorizons.com/forum/examples/css/grids/layout8.html The first thing we need to do is remove the old styling on the left hand menu. I deleted this: .side_bar { background-color: #001873; } .side_bar div{ background-color: #001873; padding: 4px; } Then we'll change the menu's HTML markup a bit, like so: <div id="side_bar_menu"> <div class="bd"> <h6>Menu Navi</h6> <ul> [*][url="#1"]Link 1[/url] [*][url="#2"]Link 2[/url] [*][url="#3"]Link 3[/url] [*][url="#4"]Link 4[/url] [*][url="#5"]Link 5[/url] [*][url="#6"]Link 6[/url] [*][url="#7"]Link 7[/url] [*][url="#8"]Link 8[/url] [/list] </div> </div> Note that I moved the Menu's header to a H6 tag, and put it inside the two divs that contain the menu. The outer div is the main container. The id attached to that div is what the javascript menu constructor will use to make the menu. The inner div is what will be the menu. It gets a class of "bd" because it's the "body" of the menu. We'll need to add in some javascript include files. We're using the YUI Menu widget, so we need this: <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.6.0/build/menu/assets/skins/sam/menu.css"> <script type="text/javascript" src="http://yui.yahooapis.com/combo?2.6.0/build/yahoo-dom-event/yahoo-dom-event.js&2.6.0/build/container/container_core-min.js&2.6.0/build/menu/menu-min.js"></script> The HTML Body element gets a class applied to it which is used by YUI to provide a default presentation for YUI widgets. <body class="yui-skin-sam"> Just before the closing </body> tag, we'll add in a <script> tag that will link the javascript file I'm using to construct the menu. <script type="text/javascript" src="layout.js"></script> The javascript code only takes two lines for us to get a menu. myMenu = new Menu('side_bar_menu', {position: 'static'}); myMenu.render(); I've wrapped my code in an anonymous self calling function and created an alias for the YAHOO.widget.Menu constructor. (Menu) The rest of the html file stays the same as it was in the last example (with css). Well, that menu doesn't look very good :( Agreed.... I took the last file and added some css to override the default YUI skin. And now the menu looks like it did before, but now it has some nifty hover over affects. http://www.phphorizons.com/forum/examples/css/grids/layout9.html All that has been added are css styles in the HTML Head of the document. Okay, but that was a lot of work just to get some hover affects... Agreed.... However we've also gained the ability to have fly out menus. Adding an unordered list to one of the LI's in the menu, and wrapping that new list with a container div (doesn't need any classes or id's) and then a second div (needs a class of "bd") will give you a fly out menu. This process can be repeated as many times as you like giving you as many submenus as you like. And here's the menu, with three sub menus, and one sub sub menu. http://www.phphorizons.com/forum/examples/css/grids/layout10.html And now you've got a fantastic set of menus that not only give users using css capable browsers an optimal experience, but users who's browsers don't accept css will still be able to access your navigation system because the HTML Markup is all semantically correct. Here's the file without any css and without the javascript menu constructor: http://www.phphorizons.com/forum/examples/css/grids/layout11.html -
HTML CSS Grids based layout (multi-column fluid pages)
Floydian replied to Floydian's topic in HTML/XHTML/CSS
Re: HTML CSS Grids based layout (multi-column fluid pages) There's one last thing I forgot. Using the Yahoo Grids and the markup associated with it allows for progressive enhancement of a website. By that I mean, if a user access your site and their browser doesn't accept css, the web site will still display in a meaningful way. http://www.phphorizons.com/forum/examples/css/grids/layout7.html This link shows the example page from the last post, with the 974px width centered layout, 160px width left hand menu, and 3 column evenly divided main content area without any css applied to the page. As you can see, the entire page still shows up in a meaningful way, allowing users of very old browser to still access and use your site. In addition, the simplicity of the markup makes the website a lot more accessible with screen readers and whatnot. -
When working with standards based HTML like HTML 4 or XHTML 1 the goal we all strive for is clean markup that will validate. A couple of the problems that arise are centering an HTML page, and creating columns for content on the page. The easiest way to achieve columns on a page is to use a table. I'm sure many of us have made a page where a table is used that takes up an entire page. The table has three rows, one for the header, the body, and the footer. The header and footer probably have a [colspan=3] on it so that the body can be split into columns using table cells. Why is using a table for layouts a problem? The first question we must ask, in order to answer this question is what element is best suited to the job? A table element is intended for use in displaying tabular data. They're great for displaying records, and lists, and all sorts of other types of data. Tables are meant to give you an easy way to keep all of that data contained in one block element. What happens if you want to move a column from the left to the right in the table? Each table row has to be edited to reflect the new table layout. Wouldn't it be great to just be able to take the entire column at once and move it from one spot to another? Sorry, but with tables, that just doesn't work. So, tables, by design, are not meant for layout. This leads us to the second point. Tables aren't all that easy to use for complex layouts, especially when those layouts are subject to change over time. CSS cascading leads us to another problem. Any style applied to a table is subject to being cascaded down to tables inside of the table. Huh? Suppose we set the font size like this: <table style="font-size: 90%"> Using % is the way Yahoo recommends setting font size. But if that style is passed from the main layout table down to tables contained within the layout table, your font sizes get progressively smaller. There are other styles that can cause "compounding" problems like that. You should be using relative measurements for font size because that allows folks that resize text on a page to be able to actually resize it. Using pixel measurements for fonts prevents that from working properly and thus site accessibility is reduced for those that can't see the small print. Nested tables are a big no no in web design. Try to avoid nesting tables as much as you can. Those are some of the reasons to not use a table for layout. Well, how else do you layout a page then? Glad you asked! The HTML Div Element is ideally suited for page layouts. The bad news is that the css rules that are needed to achieve a div based 3 column page, or x column page aren't all that easy to implement. This is where Yahoo's YUI library comes into play. There are other libraries and css sheets you can use for this. I'm using the YUI library here, feel free to use whatever you're comfortable using. Why use a library? Libraries are useful because folks that are a lot smarter than I have figured out how to achieve layouts that are consistent across the major browsers. These folks also, hopefully, maintain these libraries, updating them when a new browser comes out. Thus, using the library insulates you from changes in the browser market because the library will change and adapt to the new browsers whilst maintaining the most backwards compatibility for you. Sometimes you might have to update your code a little bit, but not anywhere near as much as you would if you were doing everything on your own. In order to make use of the YUI Library, we need to include the YUI Grids css sheet on our web page. I've made a page that has the grids css sheet in it. This page has a header, a body, and a footer section. I'm not talking about HTML <head> and <body> tags. I'm talking about a header, body, and footer section inside of the <body> tag. These will be used for out layout. http://www.phphorizons.com/forum/examples/css/grids/layout.html At this point, you'll see that there isn't much on the page. What we do get for free here though is: our page is centered. All we had to do is add in the YUI reset-fonts-grids.css package and our page will then be centered for us. You might also note that the H3 tags I used did not produce any bold print or bigger font sizes. That is a repercussion of using the reset portion of the css sheet. That is an optional deal and you can opt out of it by just including grids.css. The fonts portion of the css sheet helps to standardize fonts across browsers. The beginnings of a page layout. http://www.phphorizons.com/forum/examples/css/grids/layout2.html I've added in a div wrapper for the header, body, and footer. <div id="doc" class="yui-t1"> ....... </div> There are a number of preset layouts that Yahoo Grids provides. These are set using the id and class on this main div wrapper. This div should wrap all the content on your page. So it starts after the <body> tab and ends before the </body> tag. http://developer.yahoo.com/yui/grids/ That page lists the different presets. id="doc" gives us "750px centered (good for 800x600)" page layout. And the class="yui-t1" gives us "Two columns, narrow on left, 160px". That means the left hand side of the page will have a narrow column of 160px and the other column takes up the rest of the 750px that the id="doc" gives us. To take advantage of the yui-t1 preset, we have to add some markup to the div with the id "bd" (our body of the page layout). <div id="bd"> <div id="yui-main"> <div class="yui-b"></div> </div> <div class="yui-b"></div> </div> The yui-main div means that that div will be the main content area (the big column) That div needs to wrap the yui-b div (yui-b means a block, a block where your content goes) that will contain the main content for the page. The second yui-b div will be the narrow column. It should be noted that the second yui-b block can be placed before or after the yui-main div. The order of the markup there does not determine the order that the markup is displayed on the page. Why is this important?Using a table for left hand navigation puts your navigation before your main content. Google and other search engines might give you a lower page rank because your navigation came before the content on your page that is actually of importance. By having the ability to put your navigation AFTER your main content, you can achieve a higher page rank. I added in a style for the H3 tag as well. Make sure to view the source so you can see the changes to the script as we go. At this point, the page doesn't look all that pretty. So the next portion of edits will focus on adding some styles to the page to make it look pretty. A page with a simple layout. http://www.phphorizons.com/forum/examples/css/grids/layout3.html I've added a few styles to make the page look decent. There's no graphics, but now the header, body, and footer portions of the HTML Body can be clearly seen. There are lots of things that can be done to easily change the layout with minimal changes. The same page, with a menu on the right hand side http://www.phphorizons.com/forum/examples/css/grids/layout4.html The only change I made was to change the <div id="doc" class="yui-t1"> to <div id="doc" class="yui-t4">. So one character changes the page entirely. This is the power of YUI Grids. Want a fluid 100% page width? The same page with a 100% fluid width. http://www.phphorizons.com/forum/examples/css/grids/layout5.html Now, on this one, there's two changes. <div id="doc" class="yui-t4"> was changed to <div id="doc3" class="yui-t4">. Because the id "doc" was renamed to "doc3", the css style I applied to #doc has to be renamed as well. What about diving the main content into columns of it's own? http://www.phphorizons.com/forum/examples/css/grids/layout6.html An excellent question! The way we made the two columns for the body portion of the markup is kinda how we'll achieve this. It is a bit different though since the id="yui-main" can only be used once, at the top level. Below that, we need to use yui-g for grids, and yui-b for blocks. The basic pattern for adding two grids is: <div class="yui-g"> <div class="yui-b first">Col 1</div> <div class="yui-b">Col 2</div> </div> You can nest grids, which gives you three (if you only nest one which divides one grid into two grids) or four grids (if you nest a grid into both grids). These can be nested as deep as you wanna go. There are other grid types like yui-gb, yui-gc and so on. Please refer to the YUI Grids page for details about those. It will suffice to say, that you don't always want to split grids 50/50, sometimes you want 25/75 or 33/67. These other grid types allow you to achieve that. I used the doc4 preset for this last page. And added in a three column "yui-gb" grid which splits the columns into equal portions. By the way, did I mention the Horizons Game Engine uses Yahoo Grids for it's layout?
-
Re: [Please Read] Requesting Help I hear you Silver. In fact, my point (perhaps poorly stated), is that folks that find themselves in the position of having had their software pirated can be encouraged by my statements (hopefully) rather than let themselves worry about the pirated software. To Kaotic's point, you're comparison of software pirates to Limewire isn't a valid comparison. If anything, CE itself can be compared to Limewire (no, I'm not criticising CE) Limewire is a legitimate application which is useful for helping people to "communicate" with each other. CE is a forum that does the same thing. Limewire has survived because Limewire doesn't actually distribute pirated software, but it's the users OF limewire that pirate software. Same as CE. CE doesn't pirate game mods, it's the folks that freely post those paid mods ON CE that pirate them. The BIG difference between CE and Limewire, and this is where the comparison between the two break down, is that CE doesn't tolerate software pirating and Limewire does (at least to an extent, a large extent lol). With that said, Limewire could well be shut down. It takes a long time for litigation to shut down a company. Many folks will remember the days of Napster when it was a free p2p app. And then there was Kazaa. Can anyone find Kazaa now? And now there's Limewire. If it does get shut down, it won't be the first one that did. So, the difference between CE and p2p apps, being their respective tolerance or lack of tolerance of pirated software is the difference there, and why CE would never be subject to lawsuits. There are many cases though of users of Limewire being slapped with major lawsuits....Can anyone say RIAA....... Anyways, to finish this off, it is annoying to see entire mods posted. Most of the times it's someone that didn't pay for the script and thus doesn't get any official support. Dabs doesn't seem to be actively supporting anything he's selling/has sold though. I find it hard to see how someone can claim copyright protections against someone that needs legitimate support when he himself doesn't seem to be willing to provide that support. So, folks are forced to turn to third party sources for that help. If you put a mod out there, support it. Make sure the folks you sold the script to are happy. Make sure they never find the need to post your script somewhere because they couldn't get support from you. And if you stay on top of it, you and the CE community will know 100% for sure that any of your scripts that get posted are stolen mods.
-
Re: [Please Read] Requesting Help It's like this folks, people that use pirated software aren't where the money's at. Number one, since those are the folks willing to cut corners and break the law, they will have almost no chance of actually getting somewhere. Their game will be like every other mccodes game out there. Most folks that purchase really cool mods, don't trade them because they want exclusivity. Number two, should those folks make good money off of their pirated software and law breaking, they will be liable for lawsuits. Thus they have a built imposed limit to how successful they can be. Period. You're better off getting yourself noticed by the folks that do pay, than worrying about the folks that don't.
-
Re: PHP Memory Limit I still think it has something to do with a loop. I don't know how long that script is, but I've got scripts that span 3 to 5 thousand lines of code, and crons that can take more than 30 seconds to execute. But it's only when I get a loop that has run amuck that I get a memory error like that.
-
Re: [Request]Business Mod I'll put the companies mod up on the mccodes lite game I have running on phphorizons.com when the company mod is done ;) And for any potential buyer, willing to spend the $200 for the mod, will certainly get star treatment. ;)
-
Re: PHP Memory Limit You might want to contact your web host to see if you can get them to increase the max memory usage limit set for php in the php ini file.
-
Re: [Request]Business Mod Thanks for the plug folks ;) I do have a company mod, pretty much based on TC's company's verbatim. It's not quite finished yet, still working on the daily cron code. I had to take time off from finishing that because I needed to pump out some free Horizons Game Engine addons. I'm hoping to get back to it in a week or two, and yes, the price will be set at $200. There's nearly 5000 lines of code (could be more by the time it's done.), approximately 12 to 14 files, and one heck of a mod all together. ;)
-
Re: PHP Memory Limit Try taking the query, and running it manually (i.e., php myadmin, mysql command line, or some other mysql application). This is your query string. You just need to fill in the variables. If you don't know the values, echo this string: "SELECT iv.*,i.* FROM cars_playercars iv LEFT JOIN cars_types i ON iv.cpcCAR=i.carID WHERE cpcID={$_GET['ID']} and cpcPLAYER=$userid" or echo it: echo "SELECT iv.*,i.* FROM cars_playercars iv LEFT JOIN cars_types i ON iv.cpcCAR=i.carID WHERE cpcID={$_GET['ID']} and cpcPLAYER=$userid" See what that does when you run it manually.
-
Re: PHP Memory Limit I'm not sure either. You're probably okay posting just the portion of the code starting and ending with the foreach loop (possibly) But since it's a paid mod, does the person not support the script?
-
Re: How do I Variable Question The value that you want decremented needs to be stored in some sort of memory. You can use a session var, or store this in a database or file. I'd opt for the session var. // is the session var set? if (!isset($_SESSION['start']) { // it's not set, so initialize it $_SESSION['start'] = 10; } else { // decrement the var by one $_SESSION['start']--; }
-
Re: Error. Please help! Before you execute a line like: $db->fetch_row($q); Take the variable you pass into that, which in this case is $q and add in this bit of code: if($q === false) { echo mysql_error(); } Remember to put that before the $db->fetch_row($q);, and if $db->fetch_row($q); uses a different variable in the argument, such as $db->fetch_row($query);, you would replace $q in that if block with $query. See what that does. You likely have an error in a mysql_query somewhere. This code should tell you what that error is. And if that doesn't work, try this instead: if (!is_resource($q) ) { var_dump($q); } Same rules apply to that as the other if block. Put before the fetch array, use the variable passed to the fetch array.
-
Re: PHP Memory Limit It sounds like the script that encountered that error needs a little optimization. As far as I know, that sort of error is encountered when one script exceeds the memory limit, not when all users accessing a php script combined exceed it. ;) The cause of the error is most likely a for loop, while loop, or some other sort of loop that has run amuck.