11.07.2013, 18:55
Hello there.What I want is, when a leader of faction /invite's someone, his name goes to a file and when leader does /foff it shows the members offline.Is it possible to be done?If yes, how?Here is my /invite CMD:
pawn Код:
CMD:invite(playerid, params[])
{
if (PlayerInfo[playerid][pLeader] >= 1)
{
new string[128], ftext[50], giveplayerid;
if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /invite [playerid]");
if(IsPlayerConnected(giveplayerid))
{
if (PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pFMember] == 255)
{
if(PlayerInfo[playerid][pLeader] == 1) { ftext = "LSPD"; }
else if(PlayerInfo[playerid][pLeader] == 2) { ftext = "FBI"; }
else if(PlayerInfo[playerid][pLeader] == 3) { ftext = "SFPD"; }
else if(PlayerInfo[playerid][pLeader] == 4) { ftext = "FDSA"; }
else if(PlayerInfo[playerid][pLeader] == 5) { ftext = "Judicial System"; }
else if(PlayerInfo[playerid][pLeader] == 6) { ftext = "The Government"; }
else if(PlayerInfo[playerid][pLeader] == 7) { ftext = "SASD"; }
else if(PlayerInfo[playerid][pLeader] == 8) { ftext = "Hitman Agency"; }
else if(PlayerInfo[playerid][pLeader] == 9) { ftext = "SANews"; }
else if(PlayerInfo[playerid][pLeader] == 10) { ftext = "Arriva"; }
else if(PlayerInfo[playerid][pLeader] == 11) { ftext = "US Marine Corps"; }
else if(PlayerInfo[playerid][pLeader] == 12) { ftext = "SU"; }
else if(PlayerInfo[playerid][pLeader] == 13) { ftext = "NOOSE"; }
else { return 1; }
InviteOffer[giveplayerid] = playerid;
InviteFamily[giveplayerid] = 255;
InviteFaction[giveplayerid] = PlayerInfo[playerid][pLeader];
format(string, sizeof(string), "You have been invited to join the %s by %s - type /accept faction.", ftext, GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "You have invited %s to join the %s.", GetPlayerNameEx(giveplayerid),ftext);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "The player you're trying to invite is already in another faction or family.");
return 1;
}
}
}
else
{
SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command - only leaders can do this.");
}
return 1;
}