Y_Inline : How the fudge can this be done! - 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: Y_Inline : How the fudge can this be done! (
/showthread.php?tid=566576)
Y_Inline : How the fudge can this be done! -
Crayder - 07.03.2015
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.
Re: Y_Inline : How the fudge can this be done! -
Crayder - 07.03.2015
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?