Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Textdraw MOTD (Message Of The Day)
- // Created by AiRa LoKa
- // Credits:
- // - AiRaLoKa for converting to textdraw
- // - SplinteX for the idea
- // - Kyle_Olsen for the the original MOTD
- #define FILTERSCRIPT
- #include <a_samp>
- #include <dini>
- #define GREEN 0x21DD00FF
- #if defined FILTERSCRIPT
- static Text:RandNewsText;
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("Textdraw MOTD (Message Of The Day) by AiRa LoKa");
- print("--------------------------------------\n");
- RandNewsText = TextDrawCreate(10.000000, 435.000000, " ");
- TextDrawBackgroundColor(RandNewsText, 255);
- TextDrawFont(RandNewsText, 1);
- TextDrawLetterSize(RandNewsText, 0.35, 1.0);
- TextDrawColor(RandNewsText, GREEN);
- TextDrawSetOutline(RandNewsText, 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #else
- #endif
- public OnPlayerConnect(playerid)
- {
- new file[128];
- format(file, sizeof(file), "motd.ini");
- if(dini_Exists(file))
- {
- new string[256];
- new thing[256];
- thing = dini_Get(file, "MOTD");
- format(string, sizeof(string), "%s", thing);
- TextDrawSetString(RandNewsText, string);
- }
- 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");
- format(string, sizeof(string), "%s", thing);
- TextDrawSetString(RandNewsText, string);
- }
- TextDrawShowForPlayer(playerid, RandNewsText);
- 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");
- format(string, sizeof(string), "%s", thing);
- TextDrawSetString(RandNewsText, string);
- }
- else
- {
- SendClientMessage(playerid, GREEN, "[ERROR]: You are not a RCON administrator!");
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement