Zan Posted January 3, 2011 Posted January 3, 2011 I have many money making mods in my game (not released). i dont want cash flood in ym game in the begginig itself..so my question is How can i make a page able to be entered after reaching a certain level.. eg ..if a player is in level 1 he cant access ..it says you are not in 5th level..you neeed to be in 5th level to acces this page...something like this ..:) :rolleyes: Quote
SilvaTungDevil Posted January 3, 2011 Posted January 3, 2011 if($ir['level'] < 5) { prevent them from accessing } Quote
Zan Posted January 3, 2011 Author Posted January 3, 2011 if($ir['level'] < 5) { prevent them from accessing } Not working Quote
Zan Posted January 3, 2011 Author Posted January 3, 2011 Can someone post the full working code in which if anyone below that level eners itsays noly level5 above aloud Quote
Zan Posted January 3, 2011 Author Posted January 3, 2011 :rolleyes: Can i get the entire code pleas e? Quote
Rasheed saeed Posted January 3, 2011 Posted January 3, 2011 if ($ir['level'] < 5) { echo 'Level 5+ please.'; exit; } Quote
SilvaTungDevil Posted January 3, 2011 Posted January 3, 2011 For neatness you probably want: if ($ir['level'] < 5) { echo 'Level 5+ please.'; $h->endpage(); exit; } But that may just be me ( :) Quote
Zan Posted January 3, 2011 Author Posted January 3, 2011 thanks ilva and rasheed..appreciate it ;) Quote
Zan Posted January 3, 2011 Author Posted January 3, 2011 Oh ..but now even if the player is above level 5 it says level 5 please...why? Quote
Paddy Posted January 3, 2011 Posted January 3, 2011 FYI , maybe you want to play around with operators to fit your needs  Quote
Zan Posted January 4, 2011 Author Posted January 4, 2011 wat is this? Please someone help me in this Quote
Dominion Posted January 4, 2011 Posted January 4, 2011 wat is this? Please someone help me in this Paddy gave you what you need to fix it. Quote
Dominion Posted January 5, 2011 Posted January 5, 2011 allthe things in the table works? If the condition is right... Example - //not = to if(1 != 2) { echo 'One does not equal two...'; } Use the table to fix what's already been posted above. :) Quote
Enuf Posted January 5, 2011 Posted January 5, 2011 Also i suggest reading a few PHP tuts. Im new to PHP, but this is a very basic thing you learn. You should really buy a book or something while playing around with MCCodes lol. Makes it much easier. Quote
Paul Evans Posted January 6, 2011 Posted January 6, 2011 Operators - Comparison may help more than what paddy posted. Also maybe if ( $ir['level'] < 5 ) { echo 'Level 5+ please.'; die($h->endpage()); } No difference im just a sucker for using my own style in code Quote
Zan Posted January 6, 2011 Author Posted January 6, 2011 None of this codes are working? please help Quote
Dominion Posted January 6, 2011 Posted January 6, 2011 None of this codes are working? please help *sigh* How are you using it? Quote
Djkanna Posted January 6, 2011 Posted January 6, 2011 None of this codes are working? please help *sigh* How are you using it? Get back to your holiday... :P Quote
Dominion Posted January 6, 2011 Posted January 6, 2011 None of this codes are working? please help *sigh* How are you using it? Get back to your holiday... :P Not left yet so can't really get back to it. ;) Quote
Djkanna Posted January 6, 2011 Posted January 6, 2011 None of this codes are working? please help *sigh* How are you using it? Get back to your holiday... :P Not left yet so can't really get back to it. ;) Well get your ass gone then and have a good time :thumbup: Quote
Zan Posted January 7, 2011 Author Posted January 7, 2011 i used if ($ir['level'] < 5) { echo 'Level 5+ please.'; exit; } But now even if the player is above lvl 5 it shows lvl 5 please Quote
Diesl Posted January 7, 2011 Posted January 7, 2011 Post your entire code please. The code should work. You are either: a) using the code incorrectly b) using or reading the `level` field in your database incorrectly Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.