Give this a try, I made it a bit shorter, should be easier to add stuff now.
pawn Код:
if(!strcmp(cmd, "/invite", true))
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid/PartOfName]");
giveplayerid = ReturnUser(tmp);
if(PlayerInfo[playerid][pLeader] < 1 || PlayerInfo[playerid][pMember] < 1) return SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command (leaders only) !");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY, " This player is not connected!");
if(PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pFMember] == 255 && PlayerInfo[giveplayerid][pFactionBanned] == 0)
{
new ftext[20];
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
switch(PlayerInfo[playerid][pLeader])
{
case 1: ftext = "Police Force";
case 2: ftext = "FBI";
case 3: ftext = "SASD";
case 4: ftext = "Firemen/Ambulance";
case 5: ftext = "National Guards";
case 6: ftext = "President";
case 7: ftext = "CIA";
case 8: ftext = "Hitman Agency";
case 9: ftext = "News Agency";
case 10: ftext = "Taxi Cab Company";
case 12: ftext = "Bounty Hunter";
}
format(string, sizeof(string), "* You have Invited %s to join the %s.", giveplayer, ftext);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* %s has invited you to join the %s, (type /accept faction) to accept.",sendername, ftext);
SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
FactionOffer[giveplayerid] = playerid;
}
else return SendClientMessage(playerid, COLOR_GREY, "That player is already in a Faction / Family, or is faction banned !");
}
return 1;
}