Quote:
Originally Posted by KliPPy
PHP Code:
new req_tag[12];
get_pcvar_string(tag, req_tag, charsmax(req_tag)); // this is how you retrieve cvar string value
if(containi(name, req_tag)) // or use contain() for case-sensitive check
{
// Do something
}
|
This is wrong. Containi returns the position at which req_tag was found inside name, which can be 0 if the name starts with the tag. The value for "not found" is -1 which you need to check for explicitly:
PHP Code:
if(containi(name, req_tag) != -1) // "name" contains "req_tag"
{
// Do something
}
__________________