Jump to content
MakeWebGames

PLAYER_STATS table


wrx

Recommended Posts

im adding a demo account to develop with. after registering no player stats were created. Should i just set up the SQL here in the register.php to populate the PLAYER_STAS table or is it elsewhere as i might be missing something .

 

else // Doesn't exists we can create the account
	{
		$pass=md5(strip($_POST["PASSWORD"]));
		$sql="INSERT INTO PLAYERS(USERNAME,PASSWORD,EMAIL,AUTHORIZED) VALUES(".
		$db->qstr(strip($_POST["USERNAME"])).",".$db->qstr($pass).",".
		$db->qstr(strip($_POST["EMAIL"])).",'Y')";
		echo $sql;
		$db->Execute($sql);
		setcookie("ZAPLOGIN",$db->getid()."/".md5($pass.$_SERVER["REMOTE_ADDR"]));
		header("Location: world.php");
		return;

 

 

 

wrx

Link to comment
Share on other sites

Stats are handled for you. So you should just do something like:

set_stat("MYSTAT",100);

and that should be set.

BTW before using a stat make sure it is defined in the admin panel or directly in the table STATS

the function set_stat will change the value in memory and at the end of the page the function flush_stats will be called and actually save the new values.

Link to comment
Share on other sites

Stats are handled for you. So you should just do something like:
set_stat("MYSTAT",100);

and that should be set.

yes i see that function being used in modules/locations/train/train.php

 

BTW before using a stat make sure it is defined in the admin panel or directly in the table STATS

the function set_stat will change the value in memory and at the end of the page the function flush_stats will be called and actually save the new values.

I have seen the stats in the table, im not creating anything new yet just looking at what exists. With the exception of the admin account that was created during the install it populated the PLAYER_STATS table. When creating new users it does not create any rows in the PLAYER_STATS table so that user can not train or work because they don't not have any strength,money or energy.

{{quickstats}} is blank as well as it pulls from the PLAYER_STATS table

Link to comment
Share on other sites

these are the errors that occour when going to modules/location/train/train.php

 

Notice: Undefined index: energy in /zapengine/libs/misc_util.php on line 248

Notice: Undefined index: SHORT in /zapengine/modules/interface/quickstats/quickstats.php on line 5

:44

Notice: Undefined index: money in /zapengine/libs/misc_util.php on line 248

and error that occours when going to module/location/work/work.php

 

Notice: Undefined index: energy in /zapengine/libs/misc_util.php on line 248
Link to comment
Share on other sites

Thanks for taking the time Alain to look at this, i'll refresh shortly.

What file had the bad query ?( i would like to see it as I was unable to drill it down myself)

thanks again.

 

update: nvm i see the changelog entry for misc_util.php

 

wrx

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...