Random MOTD
#1

How Do I Make This Sends Random Saved MOTDs?

pawn Код:
for(new i = 0; i < MAX_GANGS; i++)
    {
        if(dini_Exists(gFileId(i)))
        {
        if(strval(dini_Get(gFileId(i),"GangMOTD")) != -1)
        {
        new motd[128];
        format(motd,sizeof(motd),"MOTD: %s",dini_Get(gFileId(i),"GangMOTD"));
        SendClientMessageToAll(0xFFB300FF, motd);
        break;
        }
        }
    }
It only sends me the MOTD of the first gang.

NOTE I will convert Dini to MySQL later just tell me about the motd thing.
Reply
#2

Remove break;
Reply
#3

That Will Cause Every Saved MOTD Being written like:

It will send me this:

MOTD: Blabla
MOTD BLAHBLAh

That when I have 2 Saved MOTDs
Reply
#4

Break stop the loop if you want just a few to be selected you can use something like this
if (i == 10) break;
But yeah dont put break there wherr you currently have it cause its gonna break the loop at first finding!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)