MOTD doesn't save when a server restarts.
#2

Код:
enum sInfo
{
	sMOTD[128]
};
new ServerInfo[sInfo];

forward LoadServer_data(name[], value[]);
public LoadServer_data(name[], value[])
{
	INI_String("MOTD", ServerInfo[sMOTD], 128);
	return 1;
}

// under ongamemodeinit
//Loading MOTD
// it was wrong, now paste this.
INI_ParseFile("Server/server.ini", "LoadServer_data");

CMD:motd(playerid, params[])
{
	new string[128], message[128];
	
        if(PlayerInfo[playerid][pAdmin] < 4)
	   return SCM(pid, COLOR_GREY, ERROR);
	   
	if(sscanf(params, "s[128]", message))
	   return SCM(pid, COLOR_WHITE, "USAGE: /motd [message]");
	   
	ServerInfo[sMOTD] = message;
	
	new INI:file = INI_Open("Server/server.ini");
	INI_SetTag(file, "data");
	INI_WriteString(file, "MOTD", message);
	INI_Close(file);
	
	format(string, sizeof(string), "You have set the MOTD to %s.", message);
	SCM(pid, COLOR_GREEN, string);
	
	return 1;
}
https://sampwiki.blast.hk/wiki/YSI:INI
Reply


Messages In This Thread
MOTD doesn't save when a server restarts. - by rangerxxll - 24.10.2015, 05:59
Re: MOTD doesn't save when a server restarts. - by Sabur - 24.10.2015, 07:12
Re: MOTD doesn't save when a server restarts. - by Smileys - 24.10.2015, 08:02

Forum Jump:


Users browsing this thread: 1 Guest(s)