Can someone clarify why "containi" did this?
Code:
So this is what I have, lets say that the item that is supposed to trigger this event does not have mymodel.mdl, but has a different model, but it triggers as "True", and the item that does have mymodel.mdl triggers "False"... O.o whats up with that?? doesn't !containi mean if it doesn't contain the model "mymodel"??? |
Re: Can someone clarify why "containi" did this?
Code:
contain or containi return -1 when it doesn't contain your argument. If it contain your argument I believe it will return the cell it start at. |
Re: Can someone clarify why "containi" did this?
Now everything comes out as true.
O.o I'm gonna stick with Code:
|
Re: Can someone clarify why "containi" did this?
Code:
Quote:
Since your doing if(!containi("What", "What")) So it kinda be the same thing as if(equal("What", "What")) if your checking if it return 0. |
Re: Can someone clarify why "containi" did this?
alright I'll try that when I come back from school today.
|
Re: Can someone clarify why "containi" did this?
I could be wrong on some of this...so I'll admit it if I am. This was just thrown together of the top of my head.
Code:
equal - Checks if two strings are equal. |
Re: Can someone clarify why "containi" did this?
well yeah, that SHOULD be correct
Except for that I have 2 models Lets name em: w_firstmodel.mdl, and w_secondmodel.mdl I do "containi(model, "w_firstmodel.mdl"); but models with the w_secondmodel.mdl are triggering the containi true. Why? O.o edit: I'm gonna use equali, it works (and makes more sense) :D |
Re: Can someone clarify why "containi" did this?
Code:
Is this what your code look like? If that is what it look like. Since it return -1 if it not found. Then if(-1) is still true. if(1) is still true. The only time it will return false is when it if(0) but for containi returning 0 mean it matches the string you want with the string your searching. When it return -1 it mean it couldn't find a match in your string. So you need to check it return value is greater than -1 or does not equal to -1 for contain or containi. |
Re: Can someone clarify why "containi" did this?
Gotcha. =P
|
Re: Can someone clarify why "containi" did this?
yeah mystic use equali or equal it's better :) the containi is usaly used to find letters, names.. etc
|
| All times are GMT -4. The time now is 04:45. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.