SendClientMessage(playerid, COLOR_YELLOW, "Message of The Day : ...........................");
public OnFilterScriptInit() //When the filterscript initiates
{
print("\n--------------------------------------"); //Prints something in the server box
print(" MOTD FS"); //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;
}
Credits to Kyle_Olsen btw |
C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(21) : error 026: no matching "#if..." C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(27) : error 017: undefined symbol "dini_Exists" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(30) : error 017: undefined symbol "dini_Get" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(30) : error 033: array must be indexed (variable "thing") C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(32) : error 017: undefined symbol "GREEN" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(34) : error 017: undefined symbol "dini_Create" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(35) : error 017: undefined symbol "dini_Set" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(38) : error 017: undefined symbol "dini_Get" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(38) : error 033: array must be indexed (variable "thing") C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(40) : error 017: undefined symbol "GREEN" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(53) : error 017: undefined symbol "dini_Set" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(55) : error 017: undefined symbol "dini_Get" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(55) : error 033: array must be indexed (variable "thing") C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(57) : error 017: undefined symbol "GREEN" C:\Documents and Settings\User\Desktop\Hosted Server\filterscripts\motd.pwn(60) : error 017: undefined symbol "GREEN" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 15 Errors.
#include <dini>
#define GREEN 0x00FF00FF