When i use /Fcreate to make a Family, the person i make Leader should be able to use /Invite to invite his family members. But it tells him "You are not authorized to use that command"
And im pretty sure i got it right having : "PlayerInfo[giveplayerid][pFMember] == 255)"
Invite Code.
Код:
if(strcmp(cmd, "/invite", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /invite [playerid/PartOfName]");
return 1;
}
new ftext[20];
giveplayerid = ReturnUser(tmp);
if(PlayerInfo[playerid][pLeader] >= 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
if(PlayerInfo[giveplayerid][pMember] == 0 && PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pFMember] == 255)
{
GetPlayerName(playerid, sendername, sizeof(sendername));
GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
if(PlayerInfo[playerid][pLeader] == 1) { ftext = "Police Force"; }
else if(PlayerInfo[playerid][pLeader] == 2) { ftext = "FBI"; }
else if(PlayerInfo[playerid][pLeader] == 3) { ftext = "SASP"; }
else if(PlayerInfo[playerid][pLeader] == 4) { ftext = "Firemen/Ambulance"; }
else if(PlayerInfo[playerid][pLeader] == 5) { ftext = "National Guards"; }
else if(PlayerInfo[playerid][pLeader] == 6) { ftext = "Senate"; }
else if(PlayerInfo[playerid][pLeader] == 7) { ftext = "Secret Service"; }
else if(PlayerInfo[playerid][pLeader] == 8) { ftext = "Hitman Agency"; }
else if(PlayerInfo[playerid][pLeader] == 9) { ftext = "News Agency"; }
else if(PlayerInfo[playerid][pLeader] == 10) { ftext = "Taxi Cab Company"; }
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
{
SendClientMessage(playerid, COLOR_GREY, " That player is already in a Faction / Family !");
return 1;
}
}
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command (leaders only) !");
}
}
return 1;
}