24.10.2015, 07:12
(
Последний раз редактировалось Sabur; 24.10.2015 в 18:02.
)
Код:
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; }