SA-MP Forums Archive
Checking if enum is not used - 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: Checking if enum is not used (/showthread.php?tid=288113)



Checking if enum is not used - Outcast - 06.10.2011

How can I check if the enum variables are empty? I have a house system and I want to place the new house in the closest empty (unused) variable.

ie:

enum test
{
ID,
something
}

and if I have a loop, how to check if the lets say, ID variable empty?

for(new i=0; i<5;i++)
{
if(ID = )
....
}

I cant use 0 cause it is also used as an ID in my script and it is not defined at the start. How to check if it is empty?


Re: Checking if enum is not used - iJumbo - 06.10.2011

IsNull ?


Re: Checking if enum is not used - Outcast - 11.10.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
If you can't use 0 then you need to figure out another number that you can use and do that instead. You will also need to initialise the whole of the array to that value to begin with.
That's what I thought about too. I think I'll use that. But, is the IsNull good to use or not?