Jump to content
MakeWebGames

Player Classes


Recommended Posts

  • Replies 66
  • Created
  • Last Reply

Top Posters In This Topic

Very nice modification! Looks well written as well.

Maybe instead of limiting them to money, crystal, strength etc make a drop down of all fields in the users/userstats table. I did something similar with my donation system and it was very popular.

Link to comment
Share on other sites

nice mod, been thinking of doing something like this myself, but with more in-game bonuses for the different classes

Thank you hedge. I figure this can be a start and people can build off of it like maybe add to the crons different things like faster regens etc.

Very nice modification! Looks well written as well.

Maybe instead of limiting them to money, crystal, strength etc make a drop down of all fields in the users/userstats table. I did something similar with my donation system and it was very popular.

Hmmm, not a bad idea. Ill have to look into that, no promises though :p because when it comes to .js im lost lol

Link to comment
Share on other sites

@sniko:

In a nutshell, yes. Good lookin out.

You as the admin will make up player classes like peterisgb said he had polices and hackers for example. Now lets say you have these player classes and you know in movies police always kick the bad guys ass so they need to be stronger so you can give them like 100 strength boost and hackers are generally smarter (even a broken clock is right twice a day) so you can give them a 100 labor boost when they start.

@scorpio:

Thanks and let me know how it works out for ya

Edited by KyleMassacre
Link to comment
Share on other sites

i've asked magictallguy to quick run through the codes and he said all good so i will add it later and give some feedback.

It should be pretty good to go. The only thing really that you can do which I failed to do is maybe secure the get variable a little bit but it shouldnt be too much of a problem since im not really calling and Information from the db with the get and sniko did mention to me to use filter_input () instead of filter_var which in theory would be correct since it is an input but with filter_var, if it comes out false the value entered into the db is defaulted at 0 for that flag or whatever

Link to comment
Share on other sites

  • 4 weeks later...

Hey Kyle,

I am trying to implement this mod into my game however it all seems to work apart from inserting the class Id into the users table it's setting it at 0

Not sure if its because o have a register and a validate page

Any help would be great

Also the below insert query is in our validate page as that's where it inserts the new user into the database not sure if that makes a difference

This what we have:

r=$db->fetch_row($q);

}

$_POST['gender'] = mysql_real_escape_string($_POST['gender']);

$db->query("INSERT INTO users (username, login_name, userpass, level, money, crystals, donatordays, user_level, energy, maxenergy, will, maxwill, brave, maxbrave, hp, maxhp, location, gender, signedup, email, bankmoney, lastip, lastip_signup,player_class) VALUES( '{$username}', '{$username}', md5('{$_POST['password']}'), 1, $sm, 0, 0, 1, 10, 10, 100, 100, 5, 5, 100, 100, 1, '{$_POST['gender']}', unix_timestamp(), '{$_POST['email']}', -1, '$IP', '$IP', '{$_POST['classID']}')");

$i=$db->insert_id();

Edited by Bennyh789
Link to comment
Share on other sites

yes Kyle they get an email that they have to click a link on to activate the account.

Hmm its strange cause I'm not seeing how it wouldn't insert correctly. This is an exact copy and paste from my site in which I started several accounts and it worked fine. But ill keep thinking cause now its bothering me haha.

Has anyone else tried this and getting the same issue(s)?

awesome mod

Thank you

Link to comment
Share on other sites

It seems that I forgot to add the userstats insert upon registering, im at work right now so i cant access really anything here so my bad, its a rookie mistake but basically you need to change the insert query for userstats to the variables listed above:

You're unable to view this code.

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

Something like that, the values may not be in the correct order so pay attention ;)

Link to comment
Share on other sites

You're unable to view this code.

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

 

The drop down doesnt show? It shows this for the player class bit

You're unable to view this code.

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

Any reasons why to?

 

I have got the SQL, added it into the global_func etc...

Edited by Dragon Blade
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...