C:\Users\Hash\Desktop\Elite 0.3b\gamemodes\EliteRP.pwn(44539) : warning 208: function with tag result used before definition, forcing reparse Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Header size: 9844 bytes Code size: 1748416 bytes Data size: 35699768 bytes Stack/heap size: 16384 bytes; estimated max. usage: unknown, due to recursion Total requirements:37474412 bytes 1 Warning.
Float:randomEx(randval) { new rand1 = random(2), rand2; return float(rand1 == 0 ? rand2 - random(randval) : rand2 + random(randval)); }
forward Float:randomEx(randval);
The first is to forward it, the second is to move the function to the top of the script,
if u put it at the top it wil give stack error.. just use a stock and put it below ongamemodeinit.. |
Orly? Please inform me why its giving this error then .
If you want to fix it, you have 2 options. The first is to forward it, the second is to move the function to the top of the script, before any callbacks (well, any that use this function at least). EDIT: here's the forward in-case you have no idea what i am talking about (place it on top of your script) : Код:
forward Float:randomEx(randval); |
I see someone's been reading their documentation! That makes me very happy!
If anyone cares, here's a little more explanation as to WHY the forward is required. In PAWN everything has the same type (32 bit cell), however you can treat some variables differently using tags. Floats have the "Float" tag, true and false have the "bool" tag. "Float" starts with a capital so is strong, "bool" doesn't so is weak. Strong tags can only be stored in variables with the right tag, weak tags can be stored in any weak tag variable: pawn Код:
PAWN actually has operator overloading - I bet very few of you knew that! So you can do: pawn Код:
pawn Код:
Now if you look in float.inc you will see a whole load of overloaded operators, including this one: pawn Код:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
|