SphereCommunity
test name - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: test name (/Thread-test-name)



test name - jdchixin - 02-23-2013 03:53 PM

[FUNCTION f_name_check]
FORPLAYERS 100
if (strmatch("<src.name>","<name>"))
src.sysmessage That name is not available
// src.say 111
endif
ENDFOR

is not word


RE: test name - Chris_T - 02-24-2013 02:23 PM

You could try using STRCMPI
IF !(STRCMPI("<src.name>","<name>"))


Spherewiki:
Quote:Return Value Meaning
-1 string1 is less than string2
0 The two strings are equal
1 string1 is greater than string2



RE: test name - Ultima One - 02-27-2013 03:33 AM

(02-24-2013 02:23 PM)Chris_T Wrote:  You could try using STRCMPI
IF !(STRCMPI("<src.name>","<name>"))


Spherewiki:
Quote:Return Value Meaning
-1 string1 is less than string2
0 The two strings are equal
1 string1 is greater than string2

It should read:

IF (STRCMPI(<src.name>,<name>) == 0)

using the ! will make 0 and -1 both go in to the if statement. You only want to go in if the strings match, which must == 0.

Also no need for quotes here. It will just add quotes to both names and include them in the check.