(+REP) MOTD [Message Of The Day]
#1

Hello!

I am a bit new with scripting and I would like to get this filterscript work: https://sampforum.blast.hk/showthread.php?tid=187778

I want that someone give me some tutorial how to make it (where to put files).

Thanks in advance!
Reply
#2

Run your pawn.exe
Create a new fileby hitting the new button
Select all by pressing Ctrl + A button on your keyboard
Paste the whole script you want to add to your server
Save it by hitting the save button(save in the filterscripts folder)
Compile it by clicking the compile or run button

Add the filterscript's file name to the server.cfg
E.G.:
if your filterscripts name is fs.amx
Код:
filtescripts fs

EDITED SCRIPT:


pawn Код:
/*
MOTD FilterScript by Kyle_Olsen
And fixed bug by AiRaLoKa
Do NOT remove this credit tag.
*/


#define FILTERSCRIPT //This is a filterscript
#define GREEN                   0x21DD00FF //The green color of the MOTD, if you would like another color, just change it


#include <a_samp> //Including the pawno include. Already in every server, no need to add it
#include <dini> //Including the dini include. NOT INCLUDED. Get it here: http://dracoblue.net/download-release/35/dini_1_6.zip

#if defined FILTERSCRIPT //If this is a filterscript, do anything between #if and #endif

public OnFilterScriptInit() //When the filterscript initiates
{
        print("\n--------------------------------------"); //Prints something in the server box
        print(" MOTD filterscript by Kyle_Olsen loaded\nFixed by AiRaLoKa"); //Prints something in the server box
        print("--------------------------------------\n"); //Prints something in the server box

        return 1; //Returns
}

public OnFilterScriptExit() //On the exit of the filterscript
{
        print("\n--------------------------------------"); //Prints something in the server box
        print(" MOTD filterscript by Kyle_Olsen unloaded\nFixed by AiRaLoKa"); //Prints something in the server box
        print("--------------------------------------\n"); //Prints something in the server box
        return 1;
}

#endif //Ends the if defined filterscript above

public OnPlayerConnect(playerid) //When the player connects to the server, all inside of the {} is done
{
        new file[128];
        format(file, sizeof(file), "motd.ini");
        if(dini_Exists(file)){
            new string[256];
            new thing[256];
            thing = dini_Get(file, "MOTD"); //Finds the file
            format(string, sizeof(string), "Server MOTD: %s", thing); //Creates the string
            SendClientMessage(playerid, GREEN, string); //Posts the message
        }else{
            dini_Create(file);
            dini_Set(file, "MOTD", "This is your server MOTD. Change it by signing into RCON and using the command /motd");
            new string[256];
            new thing[256];
            thing = dini_Get(file, "MOTD"); //Finds the file
            format(string, sizeof(string), "Server MOTD: %s", thing);
            SendClientMessage(playerid, GREEN, string); //Posts the message
        }
        return 1; //Returns
}
public OnPlayerCommandText(playerid, cmdtext[])
{
        new file[128];
        format(file, sizeof(file), "motd.ini");
        if (strcmp("/motd", cmdtext, true, 5) == 0)
        {
                if(IsPlayerAdmin(playerid)){
                    new string[256];
                    strmid(string, cmdtext, 6, 256);
                    dini_Set(file, "MOTD", string);
                    new thing[256];
                    thing = dini_Get(file, "MOTD"); //Finds the file
                    format(string, sizeof(string), "Server MOTD: %s", thing);
                    SendClientMessage(playerid, GREEN, string); //Posts the message

                }else{
                    SendClientMessage(playerid, GREEN, "You have to be logged into RCON in order to change the motd!");
                }
                return 1;
        }
        return 0;
}
Reply
#3

sorry for double post but is that you want?
Reply
#4

It works,thanks BUT I dont want a chat MOTD ,I want motd like that:



"Metch cook is bugged"
Reply
#5

Someone help?
Reply
#6

maybe this is want you want:

https://sampforum.blast.hk/showthread.php?pid=2822599#pid2822599
Reply
#7

Thanks,but how to move that text to the middle of the screen down as you can see on my picture?
Reply
#8

it's simple, just edit this line

Код:
RandNewsText = TextDrawCreate(CHANGE ME, 435.000000, " ");
Reply
#9

how to get the line of motd at the top
Reply
#10

Quote:
Originally Posted by Honey
Посмотреть сообщение
how to get the line of motd at the top
sorry for the late reply

you can change this line
pawn Код:
RandNewsText = TextDrawCreate(10.000000, /*CHANGE ME*/, " ");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)