Raised This Month: $ Target: $400
 0% 

How i can make a const and use them with containi


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-11-2010 , 06:15   How i can make a const and use them with containi
Reply With Quote #1

I have a doubt about this

How i can make a const and use them with containi...

Example...
PHP Code:
new const Nicks[] = { "Name1","Name2","Name3" 
PHP Code:
new name[32]
get_user_name(id,name,31)
if(
containi(name,"Nicks") != -1)
//Code... 
I'm sorry but I never used a const
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-11-2010 , 07:07   Re: How i can make a const and use them with containi
Reply With Quote #2

Code:
new const arrays[][] = {     "name1",     "name2",     "name3" } func( id ) {     new name[32]     get_user_name( id, name, 31 )     for( new i = 0; i < sizeof arrays; i++ )     {         if( containi( name, arrays[i] ) != -1 )         {             // ...         }     } }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-11-2010 , 14:52   Re: How i can make a const and use them with containi
Reply With Quote #3

10x.
Why i need to use with a loop? Just for know
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-11-2010 , 15:28   Re: How i can make a const and use them with containi
Reply With Quote #4

The loop allows you to run through each of the array cells and compare each one to the current string you have.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
#8 SickneSS
BANNED
Join Date: Sep 2008
Location: Here
Old 05-11-2010 , 15:34   Re: How i can make a const and use them with containi
Reply With Quote #5

Thanks
#8 SickneSS is offline
Send a message via MSN to #8 SickneSS Send a message via Skype™ to #8 SickneSS
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 05-11-2010 , 15:36   Re: How i can make a const and use them with containi
Reply With Quote #6

No problem.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
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 12:27.


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