gta5

  • Newbie
  • Posts: 23
Top Spree
«  »Last edited
I made a top spree command. Hopefully it helps someone.

Code: [Select]
else if ( cmd == "topspree" || cmd == "maxspree" )
    {
        //Replace "DataBase", "Accounts", "MaxSpree" as needed
        local q = QuerySQL( DataBase, "SELECT * FROM Accounts ORDER BY MaxSpree DESC LIMIT 5");
        Message("[#07ff08] Players with top Spree" );
        for (local i = 0; i < 5; i++)
        {

            local Name = GetSQLColumnData( q, 0 ); //replace 0 if needed
            local K = GetSQLColumnData( q, 4 ); //replace 4 if needed
            local D = GetSQLColumnData( q, 5 ); //replace 5 if needed
            local S = GetSQLColumnData( q, 21 ); //replace 21 if needed
            local R = format( "%.2f", K.tofloat() / D.tofloat() );

            GetSQLNextRow( q );

            if ( i == 0 ) NewTimer( "Message", 1000, 1, "[#6897BB]" + Name + " with " + S + " Spree - Ratio: " +R );
            if ( i == 1 ) NewTimer( "Message", 2000, 1, "[#6897BB]" + Name + " with " + S + " Spree - Ratio: " +R );
    if ( i == 2 ) NewTimer( "Message", 3000, 1, "[#6897BB]" + Name + " with " + S + " Spree - Ratio: " +R );
    if ( i == 3 ) NewTimer( "Message", 4000, 1, "[#6897BB]" + Name + " with " + S + " Spree - Ratio: " +R );
    if ( i == 4 ) NewTimer( "Message", 5000, 1, "[#6897BB]" + Name + " with " + S + " Spree - Ratio: " +R );

        }
    }

Inferno

  • Jr. Member
  • Posts: 98
Re: Top Spree
« Reply #1,  »
So many timers only to execute 1 function.
Viva la VU
VFS Developer
VCCNR Administrator