Raised This Month: $51 Target: $400
 12% 

Solved strfind error ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
karaulov
Senior Member
Join Date: Jul 2018
Old 11-28-2019 , 08:39   strfind error ?
Reply With Quote #1

Check for IPORT server in nickname:

Code:
public xfindip( const szIPPort[] )
{
	if (strfind(szIPPort,"27015") > 9) // 192.168.1.1:27015 not found!!!
	{
		return 1;
	}
	
	if (strfind(szIPPort,":27") > 8) // 192.168.1.1:27015 not found!!!
	{
		return 1;
	}
	return 0;
}
not works! Why ?

Last edited by karaulov; 11-29-2019 at 01:02.
karaulov is offline
LearninG
Senior Member
Join Date: Apr 2019
Location: Iran
Old 11-28-2019 , 08:49   Re: strfind error ?
Reply With Quote #2

try contain , containi

EDIT :

if (strfind(szIPPort,"27015") != -1)

Last edited by LearninG; 11-28-2019 at 09:05.
LearninG is offline
georgik57
Veteran Member
Join Date: Oct 2008
Location: 🎧Music World
Old 11-28-2019 , 08:49   Re: strfind error ?
Reply With Quote #3

just use containi
__________________
georgik57 is offline
Send a message via MSN to georgik57 Send a message via Yahoo to georgik57 Send a message via Skype™ to georgik57
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 11-28-2019 , 15:33   Re: strfind error ?
Reply With Quote #4

containi() does the same as strfind() except it's case insensitive, which doesn't matter for numbers.

They both return -1 when the string isn't found so Learnings recommendation will work.
__________________

Last edited by Bugsy; 11-28-2019 at 15:33.
Bugsy is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-28-2019 , 15:42   Re: strfind error ?
Reply With Quote #5

Better solution don't allow using more than 2 digits in the names also deny non alphabet characters...
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 21:03.


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