SA-MP Forums Archive
IsPlayerInArea/Cube ? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: IsPlayerInArea/Cube ? (/showthread.php?tid=192397)



IsPlayerInArea/Cube ? - Jefff - 22.11.2010

Is there a way to do something like
pawn Code:
public blablabla
{
    if(something == 999 && !IsPlayerInArea(...))
    else if(!IsPlayerInCube(...))
    {
        //code
    }else{
        //code
    }
    return 1;
}
2 functions in 1 public


Re: IsPlayerInArea/Cube ? - Lenny the Cup - 22.11.2010

Yes. Why wouldn't it be possible?


Re: IsPlayerInArea/Cube ? - Jefff - 22.11.2010

So can u give me an example? or someone else


Re: IsPlayerInArea/Cube ? - Jefff - 23.11.2010

none saw that topic ?


Re: IsPlayerInArea/Cube ? - Jefff - 23.11.2010

I dont want that, its too long for me
pawn Code:
public blablabla
{
    if(something == 999)
    {
        if(!IsPlayerInArea(...))
        {
            //code
        }else{
            //code
        }
    }else{
        if(!IsPlayerInCube(...))
        {
            //code
        }else{
            //code
        }
    }
    return 1;
}
is there a way to shorten this code for example
pawn Code:
public blablabla
{
    if(something == 999 && !IsPlayerInArea(...))
    else if(!IsPlayerInCube(...))
    {
        //code
    }else{
        //code
    }
    return 1;
}
only these 2 lines
pawn Code:
if(something == 999 && !IsPlayerInArea(...))
else if(!IsPlayerInCube(...))



Re: IsPlayerInArea/Cube ? - Voldemort - 23.11.2010

I suggest you to not mix else if, like

if(IHaveApple == 1) { Says: I have one apple; }
else if(IHaveBerries == 2) { Says: I have two berries; }
else if(IHaveApple == 2) { Says: I have two apple; }

I hope you got it what I mean, you should use if .. if, if you compare different things.


Re: IsPlayerInArea/Cube ? - Jefff - 23.11.2010

Ok solved, i am genious xD !!! fuck jea


Re: IsPlayerInArea/Cube ? - Bessensap - 23.11.2010

way to go genious