Raised This Month: $ Target: $400
 0% 

Array must be indexed


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 08-18-2014 , 11:00   Re: Array must be indexed
Reply With Quote #4

Quote:
Originally Posted by KliPPy View Post
PHP Code:
new req_tag[12];
get_pcvar_string(tagreq_tagcharsmax(req_tag)); // this is how you retrieve cvar string value

if(containi(namereq_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(namereq_tag) != -1// "name" contains "req_tag"
{
        
// Do something

__________________
In Flames we trust!
Nextra is offline
 



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 13:13.


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