Y_Inline : How the fudge can this be done!
#1

I know I can just make a separate function and this would go well, but I was just testing things out. Here is the code.
pawn Код:
new rand = Iter_Random(Object), count = Iter_Count(Object), playerid = Iter_Random(PlayersIn);
   
    inline GetObject()
    {
        foreach(new objectid: Object)
        {
            new Float:P[3];
            GetObjectPos(objectid, P[0], P[1], P[2]);
            if(IsPlayerInRangeOfPoint(playerid, 2.0, P[0], P[1], P[2]))
            {
                rand = objectid;
                break;
            }
        }
    }
   
    rand = random(2) ? rand : GetObject(); // LINE 45
Here is the log.
Quote:
Originally Posted by Compiler Output
...(45) : error 012: invalid function call, not a valid address
...(45) : error 029: invalid expression, assumed zero
...(45) : warning 215: expression has no effect
How exactly should inline be used in this case? I tried using and using inline, but those failed.
Reply
#2

The 'Old Topic' or the inline dialog tutorial? I've been through both but I don't 100% understand how to use it. On a side note, how are inline parameters handled in something like this: "inline(a, b, c)"? How do I specify values for those parameters?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)