Question
#2

I created this for you, you'll have to adjust the colors/looks and admin-rights to your own preferences.

At default it will hold a maximum of 6 news-messages, the newest message that's created with /news will be shown at the top and the older message will be moved 1 line down, and the last one will be deleted.

Hope you like it:

pawn Код:
#define MAX_NEWS 6
new ServerNews[MAX_NEWS][145];

COMMAND:whatsnew(playerid, params[])
{
    SendClientMessage(playerid, 0x8CD1E6FF, "Server News:");
    SendClientMessage(playerid, 0x8CD1E6FF, "---------------------------------");
    for(new i; i<MAX_NEWS; i++)
    {
        if(strlen(ServerNews[i]))
        {
            SendClientMessage(playerid, -1, ServerNews[i]);
        }
    }
    SendClientMessage(playerid, 0x8CD1E6FF, "---------------------------------");
    return 1;
}

COMMAND:news(playerid, params[])
{
    new count = (MAX_NEWS-1);
    for(new i; i<MAX_NEWS-1; i++)
    {
        format(ServerNews[count], 145, "%s", ServerNews[count-1]);
        count--;
    }
    format(ServerNews[0], 145, "%s", params);
    SendClientMessage(playerid, -1, "News message added to the news bulletin.");
    return 1;
}
Reply


Messages In This Thread
Question - by Diti1 - 19.01.2015, 18:05
Re: Question - by Schneider - 19.01.2015, 18:37

Forum Jump:


Users browsing this thread: 1 Guest(s)