Is it possible to dispose of arrays | is it possible to check if an object has been initialized or exists? [REP++]
#1

So I've been using fairly hefty global arrays based off enums, now my problem is, they seem to be initialized and using space from the second I start the script, before I even reference them, is this normal?

I also would like to use an object called Vehicles[2000] and then dispose of it after I have finished using it, now my problem is I can't keep it in the scope of a function as it's triggered by different commands.

Server starts
Array exists globally
Array is used here
Array is used there
I'd like to throw it away now
I'd like to reference it again, does it still exist? do I need to create it?

Is this possible in PAWN? I've taken quite a long break and have been fiddling with other languages and have become quite accustom to disposing of objects and creating them again when needed, often object orientated in the form of classes.
Reply
#2

You can't get rid of objects in PAWN, unfortunately. PAWN will also initialize your global vars when the script starts by default. It is a very limited language compared to C++.
Reply
#3

Is it possible to pass the whole object/an array (MooFarm[80]) to a function as the object? (Function(MooFarm)

EDIT: it works, but the question is, does it pass a reference, or the actual object.
Reply
#4

Wunderbar! it changes the original memory address, so it references the array instead of passing the values like the other data types seem to do.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)