Constant string return only first letter...
Hey! I want to ask something, that I was wondering on for a long time... When I use the constant g_szAdminPrefixes with second subscripting of [string], it always returns the first letter of the line...
Is it the problem from formatex() or from the indexing, or what? I can't find out (probably something pretty simple). PHP Code:
PHP Code:
PHP Code:
Tested the same method here: PHP Code:
http://prikachi.com/images/269/7520269V.jpg Thanks for any help and sorry fro the undescriptive problem. |
Re: Constant string return only first letter...
Idk if you can read user flags in putinserver, maybe you should use client_autorized or client_connect instead
|
Re: Constant string return only first letter...
Well, the problem is not from that. I tried to manually put different indexes in this subscript, but it everytime returns the first letter of the line...
|
Re: Constant string return only first letter...
When posting code that you have issues with, you should state the line on which the issue occurs. I shouldn't need to take 5 minutes trying to find the line to which you are originally referring. Or, better yet, you should write a small test plugin that tests just that one little thing that you are having issues with, often, people are able to discover the issue based on simply writing this test code.
|
Re: Constant string return only first letter...
Sorry abou that. I'm right now on my phone, but there is no current line. I was about to give just an example, but people often say "post the whole code". Also, I can't figure out why this is not working, when every other const used in this way works fine. So I'm basicaly out of ideas. Otherwise I wouldn't post here. Sorry, if something...
|
Re: Constant string return only first letter...
Quote:
I said to create a small test code to test the issue. I did not say that you couldn't post both the test code and the full code. If the issue occurs in the small test code, then there really is no issue with not posting the full code. If the test code works then it is imperative that you post the full code (if you state where in the code the issue occurs). |
Re: Constant string return only first letter...
Quote:
|
Re: Constant string return only first letter...
Not sure, but maybe the first element in your g_szAdminPrefixes[][eData] array(the empty string) has to do something with it. Try making it at least {"", 0}, if you already want an empty element.
And you should not recreate chat system like that, you should alter the existing one(hooking "SayText" message). Here's an example: PHP Code:
|
Re: Constant string return only first letter...
Quote:
|
Re: Constant string return only first letter...
Then it probably means there is a null character for some reason. Try outputting first few letters of the string as they are integers, so you could see their values. Like so:
PHP Code:
|
| All times are GMT -4. The time now is 13:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.