Question
#1

hey boys
i was interesting on this example i dont know how i can do it
example i do

/news Server is new to Samp List. and when someone press
/whatsnew to show the messate up here
but example when i want to change news i would press again /news and message after
/whatsnew would be changed to my last edited message someone ? :P
Reply
#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


Forum Jump:


Users browsing this thread: 2 Guest(s)