SA-MP Forums Archive
Whats wrong with this ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Whats wrong with this ? (/showthread.php?tid=322080)



Whats wrong with this ? - ShawnMiller1337 - 29.02.2012

I'm pretty sure I messed up on this... Anyone ?

pawn Код:
CMD:joingang(playerid,params[])
{
    if( PlayerInfo[playerid][pMember] >= 3 || PlayerInfo[playerid][pFMember] != 255 || PlayerInfo[playerid][pLeader] >= 3 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pDivision] >= 3 || PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pDivision] == 1)
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "You can't accept this invite as you're already in a family/faction.");
    }
        if (PlayerInfo[playerid][pLevel] < 2)
        {
            SendClientMessageEx(playerid, COLOR_GRAD1, "You must be at least level 2.");
        }
            if(IsPlayerInRangeOfPoint(playerid,3.0,2489.9746,-1691.7869,14.7656)) //Grove Street
            {
                PlayerInfo[playerid][pFMember] = 0;
                PlayerInfo[playerid][pRank] = 1;
                SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"You have successfully joined Grove Street Families (Public Gang)! Remember this is a public gang!");
                SaveFamilies();
            }
            else
            {
                SendClientMessageEx(playerid, COLOR_WHITE, "Your not in range of a gang point to join!");
            }
    }
    return 1;
}



Re: Whats wrong with this ? - Mike_Peterson - 29.02.2012

share us some information about the problem? will be alot quicker to fix then.


Re: Whats wrong with this ? - ShawnMiller1337 - 29.02.2012

warning 217: loose indentation
error 010: invalid function or declaration


Re: Whats wrong with this ? - ShawnMiller1337 - 29.02.2012

Anyone ?


Re: Whats wrong with this ? - Shockey HD - 29.02.2012

pawn Код:
CMD:joingang(playerid,params[])
{
    if( PlayerInfo[playerid][pMember] >= 3 || PlayerInfo[playerid][pFMember] != 255 || PlayerInfo[playerid][pLeader] >= 3 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pDivision] >= 3 || PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pDivision] == 1)
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "You can't accept this invite as you're already in a family/faction.");
    }
    if (PlayerInfo[playerid][pLevel] < 2)
    {
        SendClientMessageEx(playerid, COLOR_GRAD1, "You must be at least level 2.");
    }
    if(IsPlayerInRangeOfPoint(playerid,3.0,2489.9746,-1691.7869,14.7656)) //Grove Street
    {
        PlayerInfo[playerid][pFMember] = 0;
        PlayerInfo[playerid][pRank] = 1;
        SendClientMessageEx(playerid, COLOR_LIGHTBLUE,"You have successfully joined Grove Street Families (Public Gang)! Remember this is a public gang!");
        SaveFamilies();
    }
    else
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "Your not in range of a gang point to join!");
    }
    return 1;
}
This should fix the warning.

I need to know the line with the error.


Re: Whats wrong with this ? - ShawnMiller1337 - 29.02.2012

Well even though im in a faction/family
pawn Код:
if( PlayerInfo[playerid][pMember] >= 3 || PlayerInfo[playerid][pFMember] != 255 || PlayerInfo[playerid][pLeader] >= 3 || PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pDivision] >= 3 || PlayerInfo[playerid][pMember] == 2 && PlayerInfo[playerid][pDivision] == 1)
    {
        SendClientMessageEx(playerid, COLOR_WHITE, "You can't accept this invite as you're already in a family/faction.");
    }
It still comes up with I succesfully joined the gang


Re: Whats wrong with this ? - BigD - 29.02.2012

Hello,

What's your group variable? so with some servers its pGroup


Re: Whats wrong with this ? - ShawnMiller1337 - 29.02.2012

Quote:
Originally Posted by Daniel_Davis
Посмотреть сообщение
Hello,

What's your group variable? so with some servers its pGroup
pFMember


Re: Whats wrong with this ? - BigD - 29.02.2012

try changing it to

pawn Код:
PlayerInfo[playerid][pFMember] >= 1
That way it will see if there in a group or not and if they are then return that message, Hope I helped.