wrx Posted July 31, 2010 Share Posted July 31, 2010 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 Quote Link to comment Share on other sites More sharing options...
wrx Posted July 31, 2010 Author Share Posted July 31, 2010 // Create player stats (level) $id=$db->getid(); $sql="INSERT INTO PLAYER_STATS(USERID,STATID,VALUE) VALUES(".$id.",'1','1')"; echo $sql; $db->Execute($sql); Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted July 31, 2010 Share Posted July 31, 2010 If I remember right, the player stats are created when needed not before. Quote Link to comment Share on other sites More sharing options...
wrx Posted July 31, 2010 Author Share Posted July 31, 2010 after creating a new user it was unable to work or train as nothing was being added to the PLAYER_STATS table. Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted August 2, 2010 Share Posted August 2, 2010 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. Quote Link to comment Share on other sites More sharing options...
wrx Posted August 2, 2010 Author Share Posted August 2, 2010 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 Quote Link to comment Share on other sites More sharing options...
wrx Posted August 2, 2010 Author Share Posted August 2, 2010 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 Quote Link to comment Share on other sites More sharing options...
Djkanna Posted August 2, 2010 Share Posted August 2, 2010 Not so much error more of a notice :P Lemme get another copy of Zap and put it online see what happens :) Quote Link to comment Share on other sites More sharing options...
wrx Posted August 3, 2010 Author Share Posted August 3, 2010 Lemme get another copy of Zap and put it online see what happens :) ok cool everthing was working as intended until i created a new user and thats when i started seeing all the "Notices" wrx Quote Link to comment Share on other sites More sharing options...
Djkanna Posted August 3, 2010 Share Posted August 3, 2010 Yeah you're right a few notices here and there but nothing major sort of speak. It's just in need of a little TLC :D Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted August 5, 2010 Share Posted August 5, 2010 Ok I solved the issue. There was indeed a bug in the query which was retrieving the stats. Now this issue should be gone. At the same time I solved the issue with the strict warning about the timezone function. Quote Link to comment Share on other sites More sharing options...
wrx Posted August 5, 2010 Author Share Posted August 5, 2010 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.