Max Z Stock
Hi,
I have this stock that finds the highest point on the map by adding velocity until we reach CONTENTS_SKY, but sometimes it randomly spawns me on the ground. Are there any better stocks or any improvements to be done to this stock? I believe it spawns me to the ground because neither of the loops happen and return 0.0 is the return value, but why? PHP Code:
|
Re: Max Z Stock
As code says, if you go upwards before reach other than CONTENTS_EMPTY, you will then check if that place is CONTENTS_SKY & if not it will return zero. I think you need to add some content checks.
|
Re: Max Z Stock
You can try to convert this util to amxx and work with sky instead.
Spoiler
|
Re: Max Z Stock
Quote:
PHP Code:
|
Re: Max Z Stock
new Float:sth[3]
|
Re: Max Z Stock
Quote:
PHP Code:
PHP Code:
|
Re: Max Z Stock
Not loop just use 0,1,2 or use xs. You can't assign Vector to Vector cause theres no = operator, but they are same (VecA = VecB & VecA[0] = VecB[0]...)
|
Re: Max Z Stock
Quote:
PHP Code:
|
Re: Max Z Stock
I pretty much converted the first stock, all left is to test it, Crazy where did you find these stocks?
PHP Code:
|
Re: Max Z Stock
You can actually just assign an array to another one that's greater or equal in size.
|
| All times are GMT -4. The time now is 17:27. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.