Re: NEWBIE Lives system & Prompt

From: Lowrey, William O (lowreywo@jmu.edu)
Date: 02/06/00


> Well it works alright, but it doesnt stop the player from logging back in..I
> tried it by making a new char and then killing him off ten times, when i got
> to 0 i killed him one more time, but it set the lives to 255...

It won't stop them from logging in unless you do a check on
GET_LIVES(ch).

So, you will need to let them log in, pword and all.  Then at the
prompt, when they select (1) for entering the game, you will need to do
a check for GET_LIVES(ch) > 0  If it fails the check, spit out a
message saying you have died too many times.  and then you can change
their connection state to whatever you want to have happen next.

the reason that it flipped over to 255 lives when you killed him again
is because you are using an unsigned byte variable, which is from 0-
255.  When it goes below 0, it rolls over to 255.

Hope that helps some.

Novak


--
Lowrey, William O
lowreywo@jmu.edu


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/10/01 PDT