Quote:
It would be strange if it worked. After all you are trying to store string in a single variable. Try this:
PHP Code:
new count[32], count1[32], count2, count3, count4, count5
SQL_ReadResult(Query,0, count, 31) SQL_ReadResult(Query,1, count1, 31) count2 = SQL_ReadResult(Query,2) count3 = SQL_ReadResult(Query,3) count4 = SQL_ReadResult(Query,4) count5 = SQL_ReadResult(Query,5)
|
OMG, i coded the whole night, looks like i was to sleepy to use my brain.^^
Sometimes the simplest things took the most time...
Quote:
and remove that:
PHP Code:
if(count == 0) count = 1
|
Yep, forgot to delete it (used it on the rank system).
Quote:
About the 2nd problem:
PHP Code:
if(SQL_ReadResult(Query,0) || SQL_ReadResult(Query,0) == 0)
will give you the same result as
Both of them are wrong anyway. You should change it to:
PHP Code:
if(SQL_MoreResults(Query))
|
I know that, i just added the 2nd if, because it does'nt worked and i don't have to rewrite the 1st if later.
Quote:
Your way of creating toplist is very inefficient.
Why do you send 15 queries to mysql to get the toplist when you could get it with only 1 query?
I would code it this way:
1) Load toplist from mysql and store it in memory on plugin_init
2) Load player stats and store them in memory on client_authorized
3) Update toplist stored in memory when player gains points
4) Display toplist stored in memory when player wants to see toplist
5) Save player stats on client_disconnect
|
Then i have to make 15 queries on plugin_init? xD
I gotta sleep now (looks like i'm not able to code currently) xD