Quote:
Originally Posted by Liverwiz
No errors. Neither compile time, nor run time. It just simply doesn't work. I'd love for you to check out the code. I'll attach all 2k lines. God speed.
I'm aware of how sub-par code it is. But its pretty complex, and pawn doesn't make splitting up programs into separate classes easy. So i do what i can.
You can see old, working, code at this thread. Before i added the API
http://forums.alliedmods.net/showthread.php?t=185404
If you PM me i can also give you the IP to the test server (running the version i attached)
|
Can you include all files I need to compile?
Quote:
Originally Posted by Liverwiz
That's a great idea. Could you show me how to retrieve the CVAR, then store its pointer? I've never heard of doing that.
|
I included code in my post to do this.
Quote:
Originally Posted by Liverwiz
I do because its faster. Check out Exolent's tut on data types. static declarations just reserve memory space, and aren't zero'd when they come into scope. Because zeroing is the biggest performance hit, i avoid it when i can.
|
It's better in some situations, not all. If you are using a variable that would be initialized very frequently (like in prethink or cmdstart) or you're declaring a large array then it is better to use static so the memory will only need to be allocated once and then can be re-used with each instance of the function call. For declaring a single cell of data (or small array) that is not called frequently then just declare it as new.
__________________