How to make command /leaders
#1

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

How are we supposed to solve it without your code?
Reply
#3

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
};
Reply
#4

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

How?
Reply
#6

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.
Reply
#7

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

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

enum factionleader
Leader,
Reply
#9

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;
}
Reply
#10

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


Forum Jump:


Users browsing this thread: 3 Guest(s)