please help- ranking script

Discussion in 'Web Programming' started by cheat, Jan 31, 2007.

please help- ranking script
  1. Unread #1 - Jan 31, 2007 at 4:55 PM
  2. cheat
    Referrals:
    0

    cheat Guest

    please help- ranking script

    i am making a text based game but i am struggling with the stats bar, this includes:
    user
    gang
    HP
    location
    credits
    rank
    experience bar

    the problem i am having is with the ranks. the ranks are names like "killa"
    there are about 15 ranks.
    the ranks update with the experience bar, when the experience bar hits 100% then the rank changes to the next one, and the player gains 1% every 20mins.

    i am using (x)html, css, php, js, sql databases.

    i dont know how to do this script so could someone please post the script or how to do it, you can view the game here http://gangstermafia.warriorsoftime.com the game is still under development so very little is complete as i intend to do the stats first.

    please help i have been trying to do this script for 2 weeks.
     
  3. Unread #2 - Feb 1, 2007 at 5:05 PM
  4. cp
    Joined:
    Jan 30, 2007
    Posts:
    3,278
    Referrals:
    6
    Sythe Gold:
    0

    cp an cat
    Banned

    please help- ranking script

    First, you should start with the sql, the foundation.
    For user, gang, location, credits, and rank, you should use varchar(255) for sql.
    for HP, you should use int(11) or however much to limit the hp max possible.
    For experience, you should also use int, or whatever suits you, as it could work with anything.

    Then write up the form in html, and make the form processor in php and properly insert the sql into the database. Put it in correctly, or it could cause major problems. Then when you do that, you should add a login form (of course, you're missing the password field, but whatever) and use md5 to store the encrypted passwords and set a cookie with user, pass (with two md5 to it) and the time in milliseconds also encrypted in md5, to ensure xss doesn't have that big of a bad effect. Then you might want to add an admin field and in an array, put admins into an array like: $admins = array('youruser'); and add more with a comma to seperate, then add your own admin form, and make it check for admins by checking the cookie and if the username in the cookie is in the array with if(in_array($admins, $_cookie['user'])) {
    //echo out the admin panel }
    else {
    //echo out the not allowed/fail login message }

    And that should really be about it. Didn't want to add too much code to spoil your fun :)
     
< I think java error maybe? | [Python] Using The XML Library. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site