[Release] [SA:MP] [FS] Announcement Messages

Results 1 to 4 of 4
  1. #1
    Novice Seif_ is offline
    MemberRank
    Apr 2009 Join Date
    Canada Location
    2Posts

    [Release] [SA:MP] [FS] Announcement Messages

    [CENTER]About
    This filterscript allows you to send a message/announcement to everyone every x minute/second.
    The messages are modifiable in the script. Just edit line 25-26-27's message to whatever you want. If you want to increase the messages, make sure to edit the "3" in the Announcement variable to the number of announcement messages you have input.
    Also, make sure to edit the cases in GlobalAnnouncement callback. I have given you a choice of multiple colors to choose.
    Announcements are displayed every 10 minutes by default.


    Example of an edit
    Here's an example. I want to add 5 messages instead of 3(default). So I should replace the Announcements variable by this:
    PAWN Code:

    Code:
    new Announcements[5][128] = { // Announcements[number of announcement messages][string lengh]
        "Announcement: This filterscript is made by Seif",
        "Announcement: Feel free to use it but give credit if due",
        "Announcement: And edit these messages or people will think your server is weird. :-)",
        "Announcement: Type /commands to view the list of the server commands",
        "Announcement: Type /rules to read the server rules. Make sure to understand 'em!"
    };
    Then I should change the GlobalAnnouncement callback to this:
    PAWN Code:

    Code:
    public GlobalAnnouncement()
    {
        switch (Msg)
        {
            case 0: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[0]); Msg++;} // first message
            case 1: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[1]); Msg++;}
            case 2: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[2]); Msg++;}
            case 3: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[3]); Msg++;}
            case 4: {SendClientMessageToAll(ANNOUNCEMENT,Announcements[4]); Msg = 0;} // last message
        }
        return 1;
    }
    Download
    Pastebin


  2. #2
    Apprentice Homicide is offline
    MemberRank
    Dec 2010 Join Date
    13Posts

    Re: [Release] [SA:MP] [FS] Announcement Messages

    Very nice Bro Awesome!!!

  3. #3
    Alpha Member bramdebouvere is offline
    MemberRank
    Aug 2006 Join Date
    BelgiumLocation
    2,409Posts

    Re: [Release] [SA:MP] [FS] Announcement Messages

    very nice

    no offence, but why don't you do it like this? :

    SendClientMessageToAll(ANNOUNCEMENT,Announcements[Msg]);
    if (Msg>4){Msg=0;} else {Msg++;}

    and i don't know but maybe you could even do it like array.length instead of 4 (but i'm not sure if pawn has that function)

    but anyway very nice release thank you :)

    EDIT: ok sorry just noticed i replied to a very old thread here
    but i'll just leave what i said for if people want to improve their code
    Last edited by bramdebouvere; 21-12-10 at 06:56 PM.

  4. #4
    Novice espclan is offline
    MemberRank
    Apr 2011 Join Date
    1Posts

    Re: [Release] [SA:MP] [FS] Announcement Messages

    aww man looks like the link doesnt work



Advertisement