02.05.2013, 11:15
Hello, So I have seen this cool thing on a server. What it does is if there was updates added to the server you would do like /updatelist [texthere] then when you do /updates it shows it and it would be like this... No GMX yet - GMX - Texthere. If there was a GMX like this - Launched - texthere. do not tell me this is not possible as I have seen it.
Code for my /updatelist and /updates.
What I am talking about....

Now say there was a GMX it would change the gmx text to launched
Code for my /updatelist and /updates.
Код:
CMD:updates(playerid, params[])
{
// Calculating
new Year, Month, Day;
getdate(Year, Month, Day);
{
new ActualDay;
PlayerInfo[playerid][pIDay] = ActualDay;
PlayerInfo[playerid][pIMonth] = Month;
PlayerInfo[playerid][pIDay] = Day;
PlayerInfo[playerid][pIMonth] = Month;
PlayerInfo[playerid][pIYear] = Year;
}
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
new string[128], File: file = fopen("updates.cfg", io_read), idx=1;
format(string, sizeof(string), "American Roleplay - Updates until %d/%d/%d", PlayerInfo[playerid][pIMonth], PlayerInfo[playerid][pIDay], PlayerInfo[playerid][pIYear]);
SendClientMessage(playerid, COLOR_LIGHTRED, string);
while(fread(file, string))
{
format(string, sizeof(string), "{00FF00}%d) {FF6347}%s.", idx, string);
SendClientMessage(playerid, COLOR_WHITE, string);
idx ++;
}
fclose(file);
return 1;
}
CMD:updatelist(playerid, params[])
{
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "[Usage]: /updatelist [text]");
if(PlayerInfo[playerid][pAdmin] < 1338) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(AntiAdv(playerid, params)) return 1;
if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on Admin Duty.");
new File: file = fopen("updates.cfg", io_append), string[128];
format(string, sizeof(string), "%s\r\n", params);
fwrite(file, string);
fclose(file);
format(string, sizeof(string), "AdmWarn: %s has posted updates, use /updates to view it.", RPN(playerid));
SendClientMessageToAll(COLOR_LIGHTRED, string);
return 1;
}
Now say there was a GMX it would change the gmx text to launched

