Zan Posted January 3, 2011 Share 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 Link to comment Share on other sites More sharing options...
Dominion Posted January 3, 2011 Share Posted January 3, 2011 by using an if()... Quote Link to comment Share on other sites More sharing options...
SilvaTungDevil Posted January 3, 2011 Share Posted January 3, 2011 if($ir['level'] < 5) { prevent them from accessing } Quote Link to comment Share on other sites More sharing options...
Zan Posted January 3, 2011 Author Share Posted January 3, 2011 if($ir['level'] < 5) { prevent them from accessing } Not working Quote Link to comment Share on other sites More sharing options...
Zan Posted January 3, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
Dominion Posted January 3, 2011 Share Posted January 3, 2011 It was an example... Quote Link to comment Share on other sites More sharing options...
Zan Posted January 3, 2011 Author Share Posted January 3, 2011 :rolleyes: Can i get the entire code pleas e? Quote Link to comment Share on other sites More sharing options...
Rasheed saeed Posted January 3, 2011 Share Posted January 3, 2011 if ($ir['level'] < 5) { echo 'Level 5+ please.'; exit; } Quote Link to comment Share on other sites More sharing options...
SilvaTungDevil Posted January 3, 2011 Share 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 Link to comment Share on other sites More sharing options...
Zan Posted January 3, 2011 Author Share Posted January 3, 2011 thanks ilva and rasheed..appreciate it ;) Quote Link to comment Share on other sites More sharing options...
Zan Posted January 3, 2011 Author Share Posted January 3, 2011 Oh ..but now even if the player is above level 5 it says level 5 please...why? Quote Link to comment Share on other sites More sharing options...
Paddy Posted January 3, 2011 Share Posted January 3, 2011 FYI , maybe you want to play around with operators to fit your needs Quote Link to comment Share on other sites More sharing options...
Zan Posted January 4, 2011 Author Share Posted January 4, 2011 wat is this? Please someone help me in this Quote Link to comment Share on other sites More sharing options...
Dominion Posted January 4, 2011 Share Posted January 4, 2011 wat is this? Please someone help me in this Paddy gave you what you need to fix it. Quote Link to comment Share on other sites More sharing options...
Zan Posted January 5, 2011 Author Share Posted January 5, 2011 allthe things in the table works? Quote Link to comment Share on other sites More sharing options...
Dominion Posted January 5, 2011 Share 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 Link to comment Share on other sites More sharing options...
Enuf Posted January 5, 2011 Share 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 Link to comment Share on other sites More sharing options...
Paul Evans Posted January 6, 2011 Share 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 Link to comment Share on other sites More sharing options...
Zan Posted January 6, 2011 Author Share Posted January 6, 2011 None of this codes are working? please help Quote Link to comment Share on other sites More sharing options...
Dominion Posted January 6, 2011 Share Posted January 6, 2011 None of this codes are working? please help *sigh* How are you using it? Quote Link to comment Share on other sites More sharing options...
Djkanna Posted January 6, 2011 Share 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 Link to comment Share on other sites More sharing options...
Dominion Posted January 6, 2011 Share 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 Link to comment Share on other sites More sharing options...
Djkanna Posted January 6, 2011 Share 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 Link to comment Share on other sites More sharing options...
Zan Posted January 7, 2011 Author Share 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 Link to comment Share on other sites More sharing options...
Diesl Posted January 7, 2011 Share 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 Link to comment Share on other sites More sharing options...
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.