Jump to content
  • 0

Problema /members


Question

Posted

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.

19 answers to this question

Recommended Posts

  • 0
  • 0
Posted

Daca se poate sa faci tu direct pe comanda?

  • 0
Posted (edited)
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
  • 0
Posted (edited)

Incerc imediat, revin cu edit.

Citat

Acum cand scriu /members - scrie ca nu e niciun membru in fact. dar defaapt este

 

Edited by VeLo
  • 0
  • 0
Posted

Oke. dar acum cand scriu /members, arata text-ul ca nnu e nimeni in fact dar defapt este.

  • 0
  • 0
  • 0
Posted (edited)

Da-mi exact cum ai pus tu. La gm tau

Edited by VeLo
  • 0
Posted
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.");

 

  • 0
Posted

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;
}

 

  • 0
Posted

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;
}

 

  • 0
Posted

Tot la fel :|... Daca iti e de folos... folosesc gamemode-ul vProject.

  • 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.