Raised This Month: $ Target: $400
 0% 

How can I compare strings?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 07-08-2007 , 14:33   How can I compare strings?
Reply With Quote #1

There was a "equali()" command in AMXMX; but it doesn't exist in SM. Is there another function like this?
__________________
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-08-2007 , 14:42   Re: How can I compare strings?
Reply With Quote #2

strcmp(first, second, true/false) == 0

Set the third parameter to true for case sensitive, or false for non-case sensitive.

strcmp returns 0 if first is equal to second.
__________________
I'm a blast from the past!
ferret is offline
BAILOPAN
Join Date: Jan 2004
Old 07-08-2007 , 14:48   Re: How can I compare strings?
Reply With Quote #3

Or you can use StrEqual()
__________________
egg
BAILOPAN is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-08-2007 , 14:58   Re: How can I compare strings?
Reply With Quote #4

smarty pants.
__________________
I'm a blast from the past!
ferret is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 07-08-2007 , 15:25   Re: How can I compare strings?
Reply With Quote #5

Thanks
__________________

Last edited by Shaman; 07-09-2007 at 06:29.
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:44.


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