AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to check ^ in name ? (https://forums.alliedmods.net/showthread.php?t=162749)

dFF 07-22-2011 13:28

How to check ^ in name ?
 
Title ? I tryed with containi( szName, "^"" ) != -1 and doesn't work.

meTaLiCroSS 07-22-2011 14:09

Re: How to check ^ in name ?
 
PHP Code:

stock bool:StrHasChar(szString[], cChar)
{
    static 
ic
    i 
0
    
    
while((szString[i++]) != EOS)
    {
        if(
== cChar)
            
//szString[i-1] = ' '
            
return true;
    }
    return 
false;


I think that is:

Code:
if(StrHasChars(szName, '\^'))

fysiks 07-22-2011 14:49

Re: How to check ^ in name ?
 
You are checking if there is a " in the string.

:arrow:
PHP Code:

containiszName"^^" ) != -


dFF 07-22-2011 14:55

Re: How to check ^ in name ?
 
Quote:

Originally Posted by fysiks (Post 1516179)
You are checking if there is a " in the string.

:arrow:
PHP Code:

containiszName"^^" ) != -


invalid expression assumed zero

fysiks 07-22-2011 14:57

Re: How to check ^ in name ?
 
Quote:

Originally Posted by dFF (Post 1516184)
invalid expression assumed zero

Tested. I don't get that error.

dFF 07-22-2011 15:05

Re: How to check ^ in name ?
 
Yep! You're right, file must be utf-8 without bom and complie fine. Thanks and thank you meTaLiCroSS for reply.


All times are GMT -4. The time now is 01:10.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.