/bugs command help
#5

I already posted it, it is the /bugs command at the top of my post...

Код:
CMD:bugs(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;
	}
    new bugtype[64];
	if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(sscanf(params, "s[64]", bugtype))
	{
	    SendClientMessage(playerid, COLOR_WHITE, "** [Usage]:/bugs [type]");
	    SendClientMessage(playerid, COLOR_WHITE, "Valid types are: Low, Mid, Major, Fixed, All");
	    return 1;
	}
 	if(!strcmp(bugtype, "low", true))
 	{
  		if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	    if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
   		new string[128], File: file = fopen("buglow.cfg", io_read), idx=1;
		format(string, sizeof(string), "American Roleplay - Low-Bugs 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), "[%d] %s - Status:", idx, string);
			SendClientMessage(playerid, COLOR_YELLOW, string);
			idx ++;
		}
		fclose(file);
	}
	else if(!strcmp(bugtype, "mid", true))
 	{
  		if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	    if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
   		new string[128], File: file = fopen("bugmid.cfg", io_read), idx=1;
	    format(string, sizeof(string), "American Roleplay - Mid-Bugs 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), "[%d] %s - Status:", idx, string);
			SendClientMessage(playerid, COLOR_ORANGE, string);
			idx ++;
		}
		fclose(file);
	}
	else if(!strcmp(bugtype, "major", true))
 	{
  		if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
	    if(strlen(params) > 128) return SendClientMessage(playerid, COLOR_GREY, "Maximum characters limit is 128.");
   		new string[128], File: file = fopen("bugmid.cfg", io_read), idx=1;
	    format(string, sizeof(string), "American Roleplay - Major-Bugs 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), "[%d] %s - Status:", idx, string);
			SendClientMessage(playerid, COLOR_LIGHTRED, string);
			idx ++;
		}
		fclose(file);
	}
	return 1;
}
Reply


Messages In This Thread
/bugs command help - by MichaelWharton101 - 20.04.2013, 00:32
[No subject] - by Giroud12 - 20.04.2013, 00:34
Re: /bugs command help - by MichaelWharton101 - 20.04.2013, 00:36
Re: /bugs command help - by Giroud12 - 20.04.2013, 00:38
Re: /bugs command help - by MichaelWharton101 - 20.04.2013, 00:44
[No subject] - by Giroud12 - 20.04.2013, 00:48

Forum Jump:


Users browsing this thread: 1 Guest(s)