Argument type mismatch on FloatToString(), even though it should be correct.
PHP Code:
I was creating a one-time plugin to get the origin of a location. It keeps giving me the argument type mismatch error on the first argument (origin), even though I was seemingly using a float. Sourcemod is really confusing as the api (plus alliedmods api site) and error system don't really inform me of much, so if 'origin' was something like a vector I wouldn't know. |
Re: Argument type mismatch on FloatToString(), even though it should be correct.
origin is a float[3] array, not a float. A float[3] is another name for a mathematical vector.
If you're meaning to access the first index of the array, use origin[0]. If your intent is to dump all three floats, you'll have to use origin[0], origin[1], and origin[2]. ReplyToCommand takes a format Code:
ReplyToCommand(client, "%f %f %f", origin[0], origin[1], origin[2]); |
Re: Argument type mismatch on FloatToString(), even though it should be correct.
Quote:
Thanks for that, man. |
All times are GMT -4. The time now is 18:24. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.