View Single Post
jockersoft
Member
Join Date: Aug 2008
Old 10-08-2010 , 12:47   Re: Top 10 Player HlstatsCE Announcer
Reply With Quote #4

I think my arena players will like it, they keep typing top10, rank...

Can you add an option to disable the sound (check if sm_top10_sound is empty and don't precache/play it)?

And to improve your SM coding (and help you fix the plugin, otherwise it would be hard to get it approved), here are a few suggestions:
there are many loose indentation warnings while compiling. Not a big issue, but if someone uses another editor your mixing of tabs and spaces for formatting makes things difficult to read

you should use threaded queries, since the HLX db can be quite slow or on another box

you should connect to the DB only once at plugin/map start (with SQL_TConnect), not parsing the databases.cfg file everytime someone joins and then establish a connection

replace
Code:
if(SQL_GetRowCount(hQuery) > 0)
{
   SQL_FetchRow(hQuery);
with
Code:
if(SQL_FetchRow(hQuery))
{
SELECT COUNT('*'), i guess you wanted it to be SELECT COUNT(*)
(both work, but I've never seen '*' )

the -1 at the end of the query may give different results from the hlx page

you might want to hook convar changes instead of calling GetConVarString inside OnMapStart. In this way the admin that changes a convar doesn't have to wait for a changelevel. the only exception is the sound, that needs to be precached, so it is fine to update it only at change level

Last edited by jockersoft; 10-08-2010 at 12:49.
jockersoft is offline