Jump to content
  • 0

Problema /members


VeLo

Question

Problema intalnita (descriere): Pai nu stiu ce sa mai fac ca sa apara si membri offline..
Ero(area / rile) / warning-(ul / urile): Nu imi da errors dar nu apar.
Liniile de cod / sursa / script-ul(obligatoriu): 

CMD:members(playerid, params[])
{
	if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are not logged in.");
	if(PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are not member of a faction.");
	new fString[564],string[124],faction = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader],members=0;
	foreach(new i : Player)
	{
		if(PlayerInfo[i][pMember] == faction)
		{
		    string[0] = 0;
		    if(AFK[i] == 1)
		    {
				if(PlayerInfo[i][pMember] == faction) format(string, sizeof(string), "%s(%d) - Rank %d - %d/3 -(AFK)\n",GetName(i),i,PlayerInfo[i][pRank],PlayerInfo[i][pFWarns]);
			}
			else if(AFK[i] == 0)
			{
			    if(PlayerInfo[i][pMember] == faction) format(string, sizeof(string), "%s(%d) - Rank %d - %d/3\n",GetName(i),i,PlayerInfo[i][pRank],PlayerInfo[i][pFWarns]);
			}
			members++;
			strcat(fString,string);
		}
	}
	if(members == 0) return SendClientMessage(playerid, COLOR_ERROR, "No members online now.");
	format(string,sizeof(string),"Members online: %d",members);
	ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, string, fString , "Close", "");
	return 1;
}


Imagini / Video (optional): -
Ati incercat sa rezolvati singur?: Da, dar degeaba.

Link to comment
Share on other sites

19 answers to this question

Recommended Posts

  • 0
  • 0
new name[24], string[250];
	mysql_query(handle, "SELECT * FROM `accounts` WHERE `Member` = '1/2/3/4/5/6/7/8 , cat ai tu nevoie'");
	if(rows)
	{
		for(new i; i<= rows; i++)
		{
			cache_get_field_content(i, "Name", name);
			format(string, sizeof(string), "%s: Rank %d", name, cache_get_field_content_int(i, "RankLevel"));
			SCM(playerid, culoare, string);
		}
	}
	else return SCM(playerid, -1, "Nu exista membri in aceasta factiune.");

ceva de genu ar trebui sa ai in comanda.

Edited by WiDuAlK
Link to comment
Share on other sites

  • 0
  • 0
  • 0
  • 0
Citat

new name[24], string[250];
    mysql_query(handle, "SELECT * FROM `conturi` WHERE `Membru` = '4'");
    if(rows)
    {
        for(new i; i<= rows; i++)
        {
            cache_get_field_content(i, "Nume", name);
            format(string, sizeof(string), "%s: Rank %d", name, cache_get_field_content_int(i, "RankLevel"));
            SCM(playerid, Gri, string);
        }
    }
    else return SCM(playerid, -1, "Nu exista membri in aceasta factiune.");

 

Link to comment
Share on other sites

  • 0

Tot nu merge uite comanda..

 

 

CMD:members1(playerid, params[])
{
	if(gLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are not logged in.");
	if(PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader] == 0) return SendClientMessage(playerid, COLOR_ERROR, "You are not member of a faction.");
	new string[124];
	new name[24], fstring[250];
	mysql_query(handle, "SELECT * FROM `players` WHERE `Member` = '1'");
	new rows;
	if(rows)
	{
		for(new i; i<= rows; i++)
		{
			cache_get_field_content(i, "AName", name);
			format(fstring, sizeof(fstring), "%s: Rank %d", name, cache_get_field_content_int(i, "Rank"));
			format(string,sizeof(string),"Members");
			ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, string, fstring , "Close", "");
		}
	}
	else return SCM(playerid, -1, "Nu exista membri in aceasta factiune.");
	//format(string,sizeof(string),"Members online: %d",members);
	//ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, string, fString , "Close", "");
	return 1;
}

 

Link to comment
Share on other sites

  • 0

vezi asa:

CMD:members1(playerid, params[])
{
	if(gLogged[playerid] == 0)
			return SendClientMessage(playerid, COLOR_ERROR, "You are not logged in.");
			
	if(PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader] == 0) 
			return SendClientMessage(playerid, COLOR_ERROR, "You are not member of a faction.");
	
	new name[24], fstring[250];
	mysql_query(handle, "SELECT * FROM `players` WHERE `Member` = '1'");
	new rows;
	if(rows)
	{
		for(new i; i <= rows; i++)
		{
			cache_get_field_content(i, "AName", name);
			format(fstring, sizeof(fstring), "%s%s: Rank %d", fstring, name, cache_get_field_content_int(i, "Rank"));
			ShowPlayerDialog(playerid, 9999, DIALOG_STYLE_LIST, "Members", fstring , "Close", "");
		}
	}
	else return SCM(playerid, -1, "Nu exista membri in aceasta factiune.");
	return 1;
}

 

Link to comment
Share on other sites

  • 0
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.