Hy bois.
function TopKillers()
{
local
query = "SELECT Name, Mato FROM Accounts ORDER BY Name DESC LIMIT 5", //Top 5
q,
Name1, Name2, Name3, Name4, Name5,
Top1, Top2, Top3, Top4, Top5, i = 1;
q = QuerySQL( db, query );
while( GetSQLColumnData( q, 0 ) )
{
switch(i)
{
case 1:
Name1 = GetSQLColumnData( q, 0 );
Top1 = GetSQLColumnData( q, 1 );
break;
case 2:
Name2 = GetSQLColumnData( q, 0 );
Top2 = GetSQLColumnData( q, 1 );
break;
case 3:
Name3 = GetSQLColumnData( q, 0 );
Top3 = GetSQLColumnData( q, 1 );
break;
case 4:
Name4 = GetSQLColumnData( q, 0 );
Top4 = GetSQLColumnData( q, 1 );
break;
case 5:
Name5 = GetSQLColumnData( q, 0 );
Top5 = GetSQLColumnData( q, 1 );
break;
}
GetSQLNextRow( q );
i++;
}
FreeSQLQuery(q);
Message("[#00ffff]Top 5 Matadores | Killers[#000000]: [#00bfff]" + Name1 + " [#ffffff]: [#00ff00]" + Top1 + ", [#00bfff]" + Name2 + " [#ffffff]: [#00ff00]" + Top2 + ", [#00bfff]" + Name3 + " [#ffffff]: [#00ff00]" + Top3 + ", [#00bfff]" + Name4 + " [#ffffff]: [#00ff00]" + Top4 + ", [#00bfff]" + Name5 + " [#ffffff]: [#00ff00]" + Top5 + "");
}
else if (cmd =="topkiller")
{
TopKiller();
}
this ain't working. please help bois
what error you get in console?
Quote from: Groovy on Apr 12, 2020, 06:21 PMelse if (cmd =="topkiller")
{
TopKiller();
}
or is that you forgot s in 'TopKiller
s()'
i did still not working bruh.
(https://i.ibb.co/cCDMHKR/dffe.png) (https://imgbb.com/)
182th Line: q = QuerySQL( db, query );
28th Line: TopKillers();
and what is the error being displayed?
see q is null.
I think I the sqlite module failed to load, since there seems no error in query.
Is there any error in the beginning when u start the server
Quote from: umar4911 on Apr 13, 2020, 12:15 PMand what is the error being displayed?
there is no error when i open the console.
ok Groovy. do you think this is correct?
Quote from: Groovy on Apr 12, 2020, 06:21 PMquery = "SELECT Name, Mato FROM Accounts ORDER BY Name DESC LIMIT 5",
It must be the other one here. ie. your 'Mato'
@habi thanks for finding out the bug.
but one problem that when i write /topkiller it shows players with low kills not high killers...
can u post onPlayerKill code? I think player and killer got twisted.
it should be
onPlayerKiller( killer, player, reason, body part)
so that killer killed theplayer.
Solved - The problem was in code. my friend fixed it.lock topic
habi brother thanks for your help.