Jump to content
  • 0

Adaugare lideri la comanda /factions


aWm99

Question

Problema intalnita (descriere): Vreau sa adaug leaderi la comanda /factions gen:Los Santos police Departament-Numele leaderu-uli.
Ero(area / rile) / warning-(ul / urile): -
Liniile de cod / sursa / script-ul(obligatoriu):

CMD:factions(playerid, params[])
{
	if(gLogged[playerid] == 0) return SendClientMessage(playerid,COLOR_ERROR, "Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
  	new var[1024];
  	new coordsstring[64] = "ID\tNume & Nivel Minim\tMembrii\tRecrutari\n";
	for(new i = 1; i < sizeof(FactionName); i++)
	{
		if(FactionRecruit[i] == 1) format(gString, sizeof(gString), "%d\t{%s}%s{FFFFFF}\t%d\t{00cc00}ON{FFFFFF}\n", i, FactionColor2[i], FactionCommandName[i], FactionMembers(i));
		else format(gString, sizeof(gString), "%d\t{%s}%s{FFFFFF}\t%d\t{F81414}OFF{FFFFFF}\n", i, FactionColor2[i], FactionCommandName[i], FactionMembers(i));
  		strcat(var, gString);
	}
	strins(var, coordsstring, 0);
	ShowPlayerDialog(playerid, DIALOG_FACTIONS, DIALOG_STYLE_TABLIST_HEADERS, "Factiuni disponibile", var, "Inchide", "");
	return 1;
}


Imagini / Video (optional):-
Ati incercat sa rezolvati singur?: Repede pls.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Fa un callback in care sa extragi numele leaderul-ui de la factiunea dorita:

stock NumeLeader(ID)
{
	new Lider[24], query[150], temporar[24];

	mysql_format(parametri...., "SELECT * FROM `players` WHERE `Leader` = '%d', ID);//faci selectia din baza de date unde jucatorul are valoarea de leader = cu id selectat
	mysql_query(parametrii);//trimiti formatul catre baza de date
	
	cache_get_field_content(0, "Name", temp);// extragi numele jucatorului
	format(Lider, sizeof(Lider), temp);// formatezi variabila leader  = numele celui extras

	return Lider;//returnezi numele
}

iar formatul va fi ceva de genul:

format(parametrii..., "Factiunea 1 are leader %s", NumeLeader(1));
SendClientMessage(parametrii..., string);

 

Link to comment
Share on other sites

  • 0
Acum 38 minute, WiDuAlK a spus:

Fa un callback in care sa extragi numele leaderul-ui de la factiunea dorita:

stock NumeLeader(ID)
{
	new Lider[24], query[150], temporar[24];

	mysql_format(parametri...., "SELECT * FROM `players` WHERE `Leader` = '%d', ID);//faci selectia din baza de date unde jucatorul are valoarea de leader = cu id selectat
	mysql_query(parametrii);//trimiti formatul catre baza de date
	
	cache_get_field_content(0, "Name", temp);// extragi numele jucatorului
	format(Lider, sizeof(Lider), temp);// formatezi variabila leader  = numele celui extras

	return Lider;//returnezi numele
}

iar formatul va fi ceva de genul:

format(parametrii..., "Factiunea 1 are leader %s", NumeLeader(1));
SendClientMessage(parametrii..., string);

 

Boos poti explica pls pe limba mea?Ti-am zis nu ma pricep la scripting....

Link to comment
Share on other sites

  • 0
9 minutes ago, aWm99 said:

Boos poti explica pls pe limba mea?Ti-am zis nu ma pricep la scripting....

Ok pai ti-a dat codul tot ce vrei,  ce nu intelegi?

Daca nu intelegi de ce te-ai complicat sa editezi comanda /leaders?

 

    __  ____      __           
   /  |/  (_)____/ /____  _____
  / /|_/ / / ___/ __/ _ \/ ___/
 / /  / / (__  ) /_/  __/ /    
/_/  /_/_/____/\__/\___/_/     
SERVICII SCRIPTING DE CALITATE
Pagina     Scripting     pawn
Link to comment
Share on other sites

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.