/rules problem
#1

I was deciding to make a dynamic Rules and everything goes fine but there is 1 problem.I did /createrule 1 Hey (/createrule [Ruleid] [rule]) then i did /createrule 2 Hello after i checked rules and it showed this.

-------------------------Rules-------------------------
Failing to follow these rules will result you in a admin punishment.
2. Hello
1. Hey

I want the ID to go in order as in
1.Hey
2.Hello

pawn Код:
CMD:rules(playerid,params[])
{
    new rID,rRule[128];
    format(query,sizeof(query),"SELECT * FROM Rules");
    mysql_query(query);
    mysql_store_result();
    SendClientMessage(playerid,COLOR_AQUA,"-------------------------Rules-------------------------");
    SendClientMessage(playerid,red,"Failing to follow these rules will result you in a admin punishment.");
    while(mysql_retrieve_row())
    {
        mysql_fetch_field_row(str,"ID"); rID = strval(str);
        mysql_fetch_field_row(rRule,"Message");
        format(str,sizeof(str),"%d. %s",rID,rRule);
        SendClientMessage(playerid,Niceyellow,str);
    }
    mysql_free_result();
    return 1;
}
Reply
#2

doing it interactive sometime (most of the time can fail, so is better if you script it by your self
example:
Quote:

CMD:rules(playerid,params[])
{
SendClientMessage(playerid,COLOR_AQUA,"-------------------------Rules-------------------------");
SendClientMessage(playerid,red,"Failing to follow these rules will result you in a admin punishment.");
SendClientMessage(playerid,[COLOR],"1. he goes your rule.");
return 1
}

and it is easier this way , hope i help you
Reply
#3

Lol i wanted it the way i want, i just want it dynamic so i change in game so btw i fixed it so no problem
Reply
#4

ORDER BY DESC? how did u fix?
Reply
#5

Tanush can you paste the code over here as well please? I mean for this working CMD. I liked it. Want to use it for my server will keep your Credits!
Reply
#6

"SELECT * FROM Rules ORDER BY ID ASC"
Reply
#7

Quote:
Originally Posted by XFlawless
Посмотреть сообщение
"SELECT * FROM Rules ORDER BY ID ASC"
that how you fix it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)