A little doubt
#1

I like organized things so i decided to do a thing:

How i can make a stock that increase a selected row with different "cases" which i can select?

Like this:

pawn Код:
stock IncreaseStats(rowtoincrease)
{
        case 0:
        {
            new stats[128]; //Increase total accounts value
           format(stats, sizeof(stats), "UPDATE ServerStats SET TotalAccounts = TotalAccounts + 1 WHERE                  condition  = true");
       mysql_query(stats);
        }
        case 1:
        {
new stats[128]; //Increase total ac value
format(stats, sizeof(stats), "UPDATE ServerStats SET TotalAcBans= TotalAcBans + 1 WHERE condition = true");
mysql_query(stats);
        }
    }
    return 1;
}
And adding like this in a string: "IncreaseStats(0)" that will increase total accounts value, and 1 to increase total ac bans.

Got it what im saying?

P.S Sorry for bad identation, i dont know why pawn tag fucks it lol
Reply
#2

Bump.
Reply
#3

What are you trying to do? I don't really get what you're trying to do.
Reply
#4

pawn Код:
stock IncreaseStats(name[50],value = 1)
{
    new query[250];
    format(query,sizeof(query),"UPDATE `ServerStats` SET %s = %s + 1",name,name,value);
    return mysql_query(query);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)