Contain in .ini dont work
I have this and when I enter the game and test it says that the .ini file contains the user ip.. and it dosn't, it only contain "asd123 sada1231221 sdsd123".
Also when I put in the file asd123 asd4321 and print it only says the first line, why? PHP Code:
|
Re: Contain in .ini dont work
contain() and containi() return the index of the match. If it does not contain the string, it returns -1 (which will return true if used directly as the condition of an if statement). So, to properly check if a string contains another string, you need to use:
Code:
if( contain() >= 0 ) Code:
if( contain() != -1 ) |
Re: Contain in .ini dont work
Quote:
Edit: testing more I became with a bigger problem.. now I dont have a output, it dosnt put anything in say. PHP Code:
|
Re: Contain in .ini dont work
Quote:
Quote:
Also, you are using a value of 1 with contain() which is wrong, you need to use -1. If you still can't fix it, it will make it much easier to help you if you attach your .sma file. |
Re: Contain in .ini dont work
Quote:
So yes, I think the value 50000 make sense here, or even more. How can I use that value without making the server crash? Quote:
|
Re: Contain in .ini dont work
fgets() only reads a single line at a time so the variable only needs to be as long as the longest single line (plus 3). If that doesn't explain it for you then you need to attach at least an example of this INI file. Also, there is no reason that you can't use nvault or something else. If you can explain better what exactly you are trying to do, we can provide a better solution than using an INI file.
|
Re: Contain in .ini dont work
Quote:
|
All times are GMT -4. The time now is 23:41. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.