AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   If equali - some text.. (https://forums.alliedmods.net/showthread.php?t=217559)

alonelive 06-04-2013 10:12

If equali - some text..
 
Hello!

PHP Code:

new szName[32]
get_user_name(idszNamecharsmax(szName))
        
if(
equali(szName"%Player%"))
{
     
//some code


Did this works with this names, for example: "123Player1", "Player (1)", "12345Player"?
How to make this filter? Const = "Player", and a left or right part of nickname may be different.

TheDS1337 06-04-2013 10:15

Re: If equali - some text..
 
use
Code:

if( contain( szName, "Player" ) )
instead of:
Code:

if( equali( szName, "%Player%" ) )

hornet 06-04-2013 10:23

Re: If equali - some text..
 
Quote:

Originally Posted by DeagLe.Studio (Post 1964335)
use
Code:

if( contain( szName, "Player" ) )
instead of:
Code:

if( equali( szName, "%Player%" ) )

conain() actualy returns the position of found string or -1 when not found. Therefor check >= 0 .

TheDS1337 06-04-2013 10:27

Re: If equali - some text..
 
Quote:

Originally Posted by hornet (Post 1964341)
conain() actualy returns the position of found string or -1 when not found. Therefor check >= 0 .

i really don't know the different between format and formatex, equal and equali, contain and containi
can you explain ?

hornet 06-04-2013 10:40

Re: If equali - some text..
 
Quote:

Originally Posted by DeagLe.Studio (Post 1964343)
i really don't know the different between format and formatex, equal and equali, contain and containi
can you explain ?

Read the wiki rather than thread hijacking.

alonelive 06-05-2013 01:59

Re: If equali - some text..
 
.. a.. And what about my question?

YamiKaitou 06-05-2013 02:17

Re: If equali - some text..
 
Quote:

Originally Posted by alonelive (Post 1964884)
.. a.. And what about my question?

Use contain or containi

alonelive 06-05-2013 03:35

Re: If equali - some text..
 
Thank you all.
i will try it.


All times are GMT -4. The time now is 16:27.

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