Jump to content
MakeWebGames

Guess the code


Razor42

Recommended Posts

Hi there,

Got bored yesterday as the internet was down at work so started creating this feature to pass the time. It allows staff to set a code in which is a 3 number code. Players then have to guess the code and get 5 chances a day to have a guess. Each guess costs $1000 and that $1000 is added to the jackpot for someone to win. I know it's been done before but though that someone round here might like it.

So first lets add the sqls...

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Then we need to create a new file and call it guess.php...

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Then we need to create another file and call it staff_guess.php..

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Then in smenu.php add this links...

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Then in your cronday file add this....

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

Then in explore add...

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

 

And you are away to go!. I have tested and works all fine for me but if you have any issues please let me know and i'll fix ASAP :).

Link to comment
Share on other sites

  • 3 weeks later...

Love it, BUT!!!!

i think the idea behind this mod is great and i agree with adding it manually but i personally think you should change it so only $500 a time is put in the jackpot

one of the biggest killers in these games after the 14 yr olds making crap games that dont last is the economy and this is a good way of removing money from the game

maybe add more codes with higher prices to guess or something but +1 as we used to say till it was taken away you have made a good mod

Link to comment
Share on other sites

I think it has a bug. Tell me what the problem is:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Also, a few things I dislike:

Poor database naming / logically linking tables in future queries

Why the need to prefix tables? Naming conventions are not hard to adapt too. Makes programming simpler since you can use the same logic throughout.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Looks simpler to work with? I hope so, because it is. It's simple and in this case, simple works. Ever installed a mod where you need to refer to the database multiple times to recall the column naming? Yes, waste of time and avoidable if you start thinking about it right.

 

Cluttering tables with data.

I do not understand the need to further clutter an already cluttered field. Is there a point? Since your game is probably pulling all rows (SELECT * FROM), you are slowing down your system by increasing it's size. And assuming you are still using MyISAM, which I assume is being used here since their is no ENGINE added for InnoDB etc, which doesn't do table locking as MyISAM does.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

With the above, simply insert the users ID into the database in the ID field, since the row is unique and can't be duplicated.

 

Sure, this requires a couple more queries, but will be more readable and better wrote, in my opinion.

 

That is all

Link to comment
Share on other sites

  • 3 weeks later...

Found a small glitch... Still going through code so I may find more.. But in guess.php line 39 you have:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

it should be:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...