View Single Post
Antithasys
Moderator
Join Date: Apr 2008
Old 09-01-2011 , 15:38   Re: ScrollingRules
Reply With Quote #6

Some suggestions:

Create a global to get the total number of rules.
PHP Code:
//total amount of rules in file.
//get this from counting kv sections in some function
new g_iTotalRules 0
Then when you need to load the rules into the message que, or whatever.
PHP Code:
for (new 1<= g_iTotalRulesi++)
{
    
decl String:sBuffer[256];
    
Format(sBuffersizeof(sBuffer), "Rule%i"i);
    
Format(sBuffersizeof(sBuffer), "%T"sBuffer);
    
AddMsgToAllQueue(clientsBuffer);

What the above loop does is append the word 'Rule' with a number that increases... like 1, 2, 3, 4, etc... It then gets the translation for that new string and stores it. Then adds it to the queue. This way you don't need to know the literal translation phrase or the total amount of rules.

*While I didn't solve all your problems, this should get you going in the right direction.
__________________
[my plugins]

When you think about asking a question... consider what have you tried?
Antithasys is offline