13.02.2009, 18:22
How can i make that if player is a leader lets say leader : Tom Then player types /leaders Police Leader : Tom
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
|
if(PlayerInfo[playerid][pLeader] == 1) |
Originally Posted by wordas
It was just an exaple lets say:
Quote:
i think i can do most of the command but how to like if player pLeader 1 Show player nick? |
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;
}
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;
}
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; }