SA-MP Forums Archive
If Player Is a Police Leader Show Nick - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: If Player Is a Police Leader Show Nick (/showthread.php?tid=65538)



If Player Is a Police Leader Show Nick - wordas - 13.02.2009

How can i make that if player is a leader lets say leader : Tom Then player types /leaders Police Leader : Tom


Re: If Player Is a Police Leader Show Nick - Think - 13.02.2009

Quote:
Originally Posted by wordas
How can i make that if player is a leader lets say leader : Tom Then player types /leaders Police Leader : Tom
how does your cop system look like what does the leader has that normal people dont has than you dont have to change that all the time.


Re: If Player Is a Police Leader Show Nick - wordas - 13.02.2009

It was just an exaple lets say:
Quote:

if(PlayerInfo[playerid][pLeader] == 1)

]
i think i can do most of the command but how to like if player pLeader 1 Show player nick?



Re: If Player Is a Police Leader Show Nick - Think - 13.02.2009

Quote:
Originally Posted by wordas
It was just an exaple lets say:
Quote:

if(PlayerInfo[playerid][pLeader] == 1)

]
i think i can do most of the command but how to like if player pLeader 1 Show player nick?
pawn Код:
if (strcmp(cmd, "/leaders", true) == 0) // The old one
    {
        SendClientMessage(playerid, COLOR_GRAD1, "Leaders Online:");
        for(new i = 0; i <= MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i) == 1 && PlayerInfo[playerid][pLeader] == 1)
            {
                GetPlayerName(i, sendername, sizeof(sendername));
                format(string, 256, "Leader: %s", sendername);
                SendClientMessage(playerid, COLOR_GRAD2, string);
            }
        }
        return 1;
    }



Re: If Player Is a Police Leader Show Nick - ICECOLDKILLAK8 - 13.02.2009

Or if you want it to tell them if no leaders are online then
pawn Код:
if(strcmp(cmd, "/leaders", true) == 0)
    {
      SendClientMessage(playerid,COLOR_GRAY, "Leaders Online");
      new LeadersOnline;
      for(new i; i < MAX_PLAYERS; i++)
      {
        if(IsPlayerConnected(i))
        {
          if(PlayerInfo[i][pLeader])// w/e defines them as a leader, this is an example
                {
            new LeaderName[MAX_PLAYER_NAME];
            GetPlayerName(i, LeaderName, sizeof(LeaderName));
                    format(string, sizeof(string), "* Leader: %s", LeaderName);
            SendClientMessage(playerid, COLOR_YELLOW, string);
                    LeadersOnline++;
                    return 1;
                }
            }
        }
        if(LeadersOnline == 0)
        {
          SendClientMessage(playerid, COLOR_YELLOW, "* None");
        }
        return 1;
}



Re: If Player Is a Police Leader Show Nick - wordas - 13.02.2009

Thanks Guys


Re: If Player Is a Police Leader Show Nick - Typhome - 04.04.2009

Код:
	
if(strcmp(cmd, "/leaders", true) == 0)
	{
	  SendClientMessage(playerid,COLOR_GRAY, "Leaders Online");
	  new LeadersOnline;
	  for(new i; i < MAX_PLAYERS; i++)
	  {
	    if(IsPlayerConnected(i))
	    {
	      if(PlayerInfo[i][pLeader])// w/e defines them as a leader, this is an example
				{
	        new LeaderName[MAX_PLAYER_NAME];
	        GetPlayerName(i, LeaderName, sizeof(LeaderName));
					format(string, sizeof(string), "* Leader: %s", LeaderName);
	        SendClientMessage(playerid, COLOR_YELLOW, string);
					LeadersOnline++;
					return 1;
				}
			}
		}
		if(LeadersOnline == 0)
		{
		  SendClientMessage(playerid, COLOR_YELLOW, "* None");
		}
		return 1;
}
How do i make, if i have LA COSA NOSTRA faction and /members will shows who is LA COSA NOSTRA members onlines ?