Raised This Month: $32 Target: $400
 8% 

Replacement for containi ( from amx ) for sourcemod..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
V0gelz
Senior Member
Join Date: Jun 2004
Old 12-24-2007 , 18:27   Replacement for containi ( from amx ) for sourcemod..
Reply With Quote #1

Ok well i was wondering how i could like filter some text from one sentence like they did in amx. I saw that they used containi but it looks like sourcemod doesn't support that so i need to kinda find a replacement for it.
Anyone know what i can use instead?

amx code
Code:
if ( (containi(Speech, "ip") != -1) && ((containi(Speech, "serv") != -1) || (containi(Speech, "addr") != -1)) )
{
bla bla print info of server
}
I allready tryed
Code:
public Action:Command_OnSay(client, args)
{
	decl String:text[192];
	GetCmdArgString(text, sizeof(text));
	
	new startidx;
	
	if (text[strlen(text)-1] == '"')
	{
		text[strlen(text)-1] = '\0';
		startidx = 1;
	}
	if ( strcmp(text[startidx], "ip", false) == 0 && strcmp(text[startidx], "serv", false) == 0 )
 	{
		SendMsg_TextMsg(client,HUD_PRINTTALK, "<Server Auto-Response> Server IP: 127.0.0.1:27015");
	}
}
But doesn't realy work because it needs to be exact that word and only that word in the sentence...

Thanks in advance
V0gelz is offline
pRED*
Join Date: Dec 2006
Old 12-24-2007 , 18:51   Re: Replacement for containi ( from amx ) for sourcemod..
Reply With Quote #2

http://docs.sourcemod.net/api/index....d=show&id=615&
pRED* is offline
V0gelz
Senior Member
Join Date: Jun 2004
Old 12-25-2007 , 03:52   Re: Replacement for containi ( from amx ) for sourcemod..
Reply With Quote #3

Oh man :p thanks pred!
V0gelz is offline
Reply


Thread Tools
Display Modes

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 02:37.


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