/bugs command help
#1

Okay So I have it so I can do '/bugs low/mid/major' but want it so I can also do '/bugs all' but can not seem to figure it out... Please help me

Code for /bugs
Код:
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
#2

DELETED
Reply
#3

It has no error I want it so I can also do /bugs all and it will show me all the bugs
Reply
#4

Ok, let see the code.
Reply
#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
#6

DELETED
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)