Quote:
|
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 think it didn't work right just. I have modified query_handler a bit so it should ONLY insert data if old one it's not found.
Quote:
|
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);
|
You check if data is in database by executing Run_query(1) and perform this check.
PHP Code:
if(SQL_NumResults(Query) > 0) {
//action here
}
If query returns more than 1 row, your action will be executed.
============================================
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:
//#include <dhudmessage>
In fw_CounterEntThink( iEntity ). You can delete server_cmd aswell.
PHP Code:
/*
if( !g_bHideTimer ) {
set_hudmessage(255, 204, 0, 0.62, 0.96, 0, _, 0.2, 0.1, 0.1); // creates the hud message
show_hudmessage( 0 , "Time: %i:%.2i:%.3i ^nRecord: %i:%.2i:%.3i" , g_iTimer/60, g_iTimer/60*2, g_iTimer, g_iRecTimer/60, g_iRecTimer/60*2, g_iRecTimer ); // show the counter in hudmessage
server_cmd("TIMER NOW - min: %d s: %d, i: %d -- SQL TIMER - min: %d sec: %d i: %d", g_iTimer/60, g_iTimer/60*2, g_iTimer, g_iRecTimer/60, g_iRecTimer/60*2, g_iRecTimer);
}*/
PHP Code:
//SQL_QueryAndIgnore(SqlConnection,"DROP TABLE IF EXISTS `AM_recordtimes`")
Compile and.. run this code only ONCE on your server.
After delete the line and recompile the plugin.
PHP Code:
//SQL_QueryAndIgnore(SqlConnection,"DROP TABLE IF EXISTS `AM_recordtimes`")
Now you should have a new table with only 3 colums. Check if it does in your phpmyadmin.
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.