Thankfully Asherkin on the IRC demonstrated how I could fix this.
I made a variable called bool:HasMapLoaded;
Then set it to true during OnMapStart. If I want to check if the map had loaded before spawning my entity, I just use if(!HasMapLoaded) { return; }. That stops the script if the map hasn't loaded yet.
OnMapEnd sets the variable back to false.
Quote:
Originally Posted by NIGathan
|
Neither. I am also aware of those functions already. I wanted to find if there was a function to return true/false if the map was running, so I could run a block of code based on that condition. Ie. if(IsMapRunning == true) { // Do something }. Turns out there wasn't, so I had to do what Asherkin advised me to do above.
Quote:
|
Edit: I m guessing that you did not preached your entity onmapstart ().
|
Had nothing to do with that, plus, it wouldn't have made a difference in the context / situation the entity is used in. As far as I'm aware, entities cannot be "precached" in the same sense of models, textures, and sounds to begin with.