/faction problem
#1

Hello I got a problem

When I try to add a /faction OOC chat I get "You are not a member of a faction / family !"

pawn Код:
if(strcmp(cmd, "/faction", true) == 0 || strcmp(cmd, "/f", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if(!(PlayerInfo[playerid][pMember] >= 8 && PlayerInfo[playerid][pMember] <= 10 || PlayerInfo[playerid][pFMember] != 255))
                return SendClientMessage(playerid,COLOR_GREY,"   You are not part of a Faction !");
            if(gFam[playerid]) return 1;
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[256];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/f)amily [family chat]");
                return 1;
            }
            if(PlayerInfo[playerid][pMember] >= 8 && PlayerInfo[playerid][pMember] <= 10)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendFamilyMessage(PlayerInfo[playerid][pMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 1)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 2)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 3)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 4)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 5)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 6)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 7)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 8)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 9)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pMember] != 10)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
            else if(PlayerInfo[playerid][pFMember] != 255)
            {
                format(string, sizeof(string), "(( (%d) %s %s: %s ))", PlayerInfo[playerid][pRank],GetPlayerRank(playerid),PlayerName(playerid), result);
                SendNewFamilyMessage(PlayerInfo[playerid][pFMember], TEAM_AZTECAS_COLOR, string);
            }
        }
        return 1;
Reply
#2

Bump - Urgent
Reply
#3

Bump - urgent, Please Help Me
Reply
#4

if(!(PlayerInfo[playerid][pMember] >= 8 && PlayerInfo[playerid][pMember] <= 10 || PlayerInfo[playerid][pFMember] != 255))

This condition is not true... Try make it true
Reply
#5

Could you write that in the code please
Reply
#6

You want all factions to be able to use this cmd?

When is player not in faction? When pMember is 0 ?
Reply
#7

I want all factions to use it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)