SA-MP Forums Archive
How to make command /leaders - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to make command /leaders (/showthread.php?tid=596104)



How to make command /leaders - ervinmasic - 12.12.2015

I use South Central RolePlay, and faction system is dynamic, and its complicated to make /leaders command. Please help me..
Thanks


Re: How to make command /leaders - ATGOggy - 12.12.2015

How are we supposed to solve it without your code?


Re: How to make command /leaders - ervinmasic - 12.12.2015

What code u want?

EDIT:
This is /makeleader command:
Код:
CMD:postavilidera(playerid, params[])
{
	static
		userid,
		id;

    if (PlayerData[playerid][pAdmin] < 5)
	    return SendErrorMessage(playerid, "Niste ovlasteni.");

	if (sscanf(params, "ud", userid, id))
	    return SendSyntaxMessage(playerid, "/postavilidera [playerid/ime] [organizacija id] (Koristi -1 da skines lidera)");

	if (userid == INVALID_PLAYER_ID)
	    return SendErrorMessage(playerid, "Netacan ID igraca.");

    if ((id < -1 || id >= MAX_FACTIONS) || (id != -1 && !FactionData[id][factionExists]))
	    return SendErrorMessage(playerid, "Unijeli ste netacan ID organizacije.");

	if (id == -1)
	{
	    ResetFaction(userid);

	    SendServerMessage(playerid, "Skinuli ste lidera igracu %s.", ReturnName(userid, 0));
    	SendServerMessage(userid, "Administrator %s vam je skinuo lidera.", ReturnName(playerid, 0));
	}
	else
	{
		SetFaction(userid, id);
		PlayerData[userid][pFactionRank] = FactionData[id][factionRanks];

		SendServerMessage(playerid, "Postavili ste igracu %s lidera organizacije \"%s\".", ReturnName(userid, 0), FactionData[id][factionName]);
    	SendServerMessage(userid, "Administrator %s vas je postavio za lidera organizacije \"%s\".", ReturnName(playerid, 0), FactionData[id][factionName]);
	}
    return 1;
}
This is faction data:
Код:
enum factionData {
	factionID,
	factionExists,
	factionName[32],
	factionColor,
	factionType,
	factionRanks,
	Float:factionLockerPos[3],
	factionLockerInt,
	factionLockerWorld,
	factionSkins[8],
	factionWeapons[10],
	factionAmmo[10],
	Text3D:factionText3D,
	factionPickup,
	Float:SpawnX,
	Float:SpawnY,
	Float:SpawnZ,
	SpawnInterior,
	SpawnVW
};



Re: How to make command /leaders - saffierr - 12.12.2015

Well without the code, I just can tell you to make a loop through all leaders.


Re: How to make command /leaders - ervinmasic - 13.12.2015

How?


Re: How to make command /leaders - Denying - 13.12.2015

You could simply add a "factionLeader[MAX_PLAYER_NAME]" to your enum factionData. Then go to makeleader command and use something like format(FactionData[id][factionLeader], 24, "%s", ReturnName(userid, 0));

Then, in your /leaders command, make a loop to loop through all existing factions and just display that specific variable.


Re: How to make command /leaders - ervinmasic - 14.12.2015

I dont know to make it, can you make it for me? Please
Thanks


Re: How to make command /leaders - Elegy - 14.12.2015

Lol,if u cant script,dont play samp n dont make server
as he said ,go do that

enum factionleader
Leader,


Re: How to make command /leaders - Assassin007 - 14.12.2015

This is a command to show admins online it is basicly the same princip for leaders...


Код:
YCMD:admins(playerid, params[])
{
	if(gPlayerLoggedIn[playerid] == 0) return 1;

	SendClientMessage(playerid, COLOR_WHITE, "Administrators online:");
	foreach(Player, i)
	{
	    new level[128], string[128];

		if(PlayerInfo[playerid][Admin] == 0 && PlayerInfo[i][Admin] > 1 /*&& AdminDuty[i] == 1*/)
		{
		    switch(PlayerInfo[i][Admin])
		    {
		        case 2: level = "Junior Admin";
		        case 3: level = "General Administrator";
		        case 4: level = "Head Administrator";
		        case 5: level = "Community Owner";
			}
			format(string, sizeof(string), "%s %s", level, PlayerName(i));
			SendClientMessage(playerid, COLOR_GREY, string);
		}
		if(PlayerInfo[playerid][Admin] > 0)
		{
      		switch(PlayerInfo[i][Admin])
		    {
		        case 1: level = "Secret Admin (1)";
		        case 2: level = "Junior Admin (2)";
		        case 3: level = "General Administrator (3)";
		        case 4: level = "Head Administrator (4)";
		        case 5: level = "Community Owner (5)";
			}
			format(string, sizeof(string), "%s %s", level, PlayerName(i));
			SendClientMessage(playerid, COLOR_GREY, string);
		}
	}
	return 1;
}



Re: How to make command /leaders - PrO.GameR - 14.12.2015

Quote:
Originally Posted by Elegy
Посмотреть сообщение
Lol,if u cant script,dont play samp n dont make server
as he said ,go do that

enum factionleader
Leader,
Oh the Irony,
https://sampforum.blast.hk/showthread.php?tid=596196
Doesn't know how to change a dialog's format .. tells other people they shouldn't make servers if they can't ..