SA-MP Forums Archive
Can somebody help me spot the problem with this code? - 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: Can somebody help me spot the problem with this code? (/showthread.php?tid=308016)



Can somebody help me spot the problem with this code? - cloudysky - 01.01.2012

pawn Код:
if(CarCheck == Cars[c12] )
        {
            if(gTeam[playerid] == TEAM_BALLAS)
            {
                if( PlayerInfo[playerid][level] >= 5)
                {
                    SendClientMessage(playerid, COLOUR_PURPLE, "You are now flying your teams Maverick!");
                }
                else
                {
                    SendClientMessage(playerid, COLOUR_RED, "You are not in the Ballas or you are not Level 5!");
                    RemovePlayerFromVehicle(playerid);
                }
            }
I've been looking for ages.When someone from the Ballas gets in it kicks them from the chopper saying they have to be level 5, that's what i want it to say but if someone from Grove, level 1 - 5 gets in it lets them fly even though the chopper is set for Ballas only. Anyone see the problem?


Re: Can somebody help me spot the problem with this code? - Face9000 - 01.01.2012

pawn Код:
if( PlayerInfo[playerid][level] == 5)



Re: Can somebody help me spot the problem with this code? - cloudysky - 01.01.2012

Quote:
Originally Posted by Logitech90
Посмотреть сообщение
pawn Код:
if( PlayerInfo[playerid][level] == 5)
Thanks for the swift reply, however this is just for the level not for the team.


Re: Can somebody help me spot the problem with this code? - Jefff - 01.01.2012

if(gTeam[playerid] == TEAM_BALLAS || gTeam[playerid] == TEAM_GROOVE)


Re: Can somebody help me spot the problem with this code? - cloudysky - 01.01.2012

Quote:
Originally Posted by Jefff
Посмотреть сообщение
if(gTeam[playerid] == TEAM_BALLAS || gTeam[playerid] == TEAM_GROOVE)
That would let Grove get it the problem is that Grove is getting in the chopper and flying it when i dont want them to.


Re: Can somebody help me spot the problem with this code? - Mokerr - 02.01.2012

pawn Код:
if(gTeam[playerid] == TEAM_BALLAS)
    {
        if( PlayerInfo[playerid][level] >= 5)
        {
            SendClientMessage(playerid, COLOUR_PURPLE, "You are now flying your teams Maverick!");
        }
        else
        {
             SendClientMessage(playerid, COLOUR_RED, "You are not level 5!");
             RemovePlayerFromVehicle(playerid);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOUR_RED, "You are not in the Ballas team!");
        RemovePlayerFromVehicle(playerid);
    }