[Help - SQL] Saving Timer vallue's
1 Attachment(s)
I made a Timer plugin and i now I added mysql saving to it but my table is not being created.
my sql database information and login are all correct, triple checked and the plugin is running and not set into bad load. Could anyone pls take a look? I'm out of idea's I used this tutorial for the mysql saving. |
Re: [Help - SQL] Saving Timer vallue's
I don't see you using MySql_Init() anywhere... :roll:
And why do you need all minutes, seconds, milliseconds in your table? You could only save seconds and turn them into minutes, seconds and milliseconds when you load them from SQL. |
Re: [Help - SQL] Saving Timer vallue's
- What are you talking about? mysql_init is placed right after plugin_init.
- Yes that's true but i'm not sure if it would work, didnt really tough about that at the time. but my milisecond timer (g_icounter) resets to 0 every 1000ms or 1second. and seconds reset to 0 at 1 minute so saving only the seconds wouldnt work the way i coded the plugin like it is now |
Re: [Help - SQL] Saving Timer vallue's
Quote:
What are you really trying to do? If you're just looking for a timer with milliseconds check this out: http://forums.alliedmods.net/showpos...85&postcount=6 |
Re: [Help - SQL] Saving Timer vallue's
Aha, i see i forgot to set the mysql_init taks in plugin_init and the public function IgnoreHandle.
I will update it when i got home and see what that gives. what i am trying to do is save record roundtimes into sql, my endgoal is to proces that plugin into another plugin i made to extend the gameplay. |
Re: [Help - SQL] Saving Timer vallue's
1 Attachment(s)
Ok so this is what i have now, the table is now created in my database but there are no values inside, when actually when a new map is loaded without records in it yet it should save these vallues: 99min 99 secs 999 ms but its not saving those vallues or even registering the map in the table
PHP Code:
Spoiler
|
Re: [Help - SQL] Saving Timer vallue's
1 Attachment(s)
1. That's because you have an error in your Insert query. Find 5 differences, lol.
PHP Code:
PHP Code:
3. Btw, this part code is useless if you have created the table. Unless nobody else will delete your table, you'll be fine. In MySQL_Init(), delete. PHP Code:
Here's one cool from Arkshine http://forums.alliedmods.net/showthread.php?t=172128 I have modified your code a bit since I got bored. Read the comments inside of it. Enjoy. |
Re: [Help - SQL] Saving Timer vallue's
Code:
:) |
Re: [Help - SQL] Saving Timer vallue's
1 Attachment(s)
thanks alot Infernuz ,
but there are still a couple mistakes in: in check_times() the game has to check if the new time is a new record so when the if statement is 1 the new time has to be saved as the new record, as how you did it, it saved the vallue's 99m 99s999ms so i changed that to Run_query(3); but now i think that when a new map without data is loaded it doesnt automaticly set the times to 99,99,999 and also when a map is correctly loaded i think it will also store 99.99.999 becous when you load querry(1) in plugin_init it will run querry(2) in the public query_handler. I'm not sure how to check if there is data in the table for a new map so that only then the times 99m99s999ms are stored by performing Run_query(2); |
Re: [Help - SQL] Saving Timer vallue's
2 Attachment(s)
Quote:
Quote:
PHP Code:
============================================ I remade your plugin completly and the saving to db. Tested, saves and gets the data with no problems. Before you use it uncomment these. PHP Code:
PHP Code:
PHP Code:
After delete the line and recompile the plugin. PHP Code:
If you get errors, post them here. If you don't understand something in this plugin, ask. 1MsTimer - is with old code commented. SaveRecord - without. Cheers. |
| All times are GMT -4. The time now is 05:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.