Local enum's possible? - 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: Local enum's possible? (
/showthread.php?tid=175481)
Local enum's possible? -
toneysix - 10.09.2010
HI. Can I use enum constructs as local variables, in functions, block etc.
In stock's it's works fine, but in dialogs block, it's leaks and and the compiler is wrong, like i lost bracket somewhere.
Re: Local enum's possible? -
Toni - 10.09.2010
No, I think they are only global, they can't really be added locally.
Re: Local enum's possible? -
toneysix - 10.09.2010
Hm. But why in stocks work's fine and won't leak like in dialogs blocks.
Re: Local enum's possible? -
bigcomfycouch - 10.09.2010
stocks don't print the same errors that regular functions do
Re: Local enum's possible? -
toneysix - 10.09.2010
If it's not used.
Re: Local enum's possible? -
bigcomfycouch - 10.09.2010
This compiled fine ( except warnings because I did not use the array )
pawn Код:
stock ya()
{
enum fff
{
ff
}
new f[10][fff];
}
forward yaa();
public yaa()
{
enum fff
{
ff
}
new f[10][fff];
}
Both methods were called in OnGameModeInit
Not sure why yours didn't
Re: Local enum's possible? -
toneysix - 10.09.2010
bigcomfycouch as i said, it's works for stock's but doesn't works for dialogs response public.
Re: Local enum's possible? -
bigcomfycouch - 10.09.2010
Post your code or something. I made a local enum inside that callback and it worked fine.
pawn Код:
enum fff
{
ff,
Float: ffff
}
new f[10][fff];
f[0][ff] = 100;
f[0][ffff] = 8712.21489;