SA-MP Forums Archive
/rules problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /rules problem (/showthread.php?tid=307272)



/rules problem - Tanush123 - 29.12.2011

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;
}



Respuesta: /rules problem - diego_p11 - 29.12.2011

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


Re: /rules problem - Tanush123 - 01.01.2012

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


Re: /rules problem - jamesbond007 - 01.01.2012

ORDER BY DESC? how did u fix?


Re: /rules problem - Ballu Miaa - 01.01.2012

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!


Re: /rules problem - XFlawless - 01.01.2012

"SELECT * FROM Rules ORDER BY ID ASC"


Re: /rules problem - Tanush123 - 01.01.2012

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