Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- MOTD FilterScript by Kyle_Olsen
- 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"); //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"); //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;
- }
Advertisement
Add Comment
Please, Sign In to add comment