Raised This Month: $ Target: $400
 0% 

[SOLVED]For-Loops, Contain, len++ MOTD's


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 10-28-2005 , 23:06   [SOLVED]For-Loops, Contain, len++ MOTD's
Reply With Quote #1

Quote:
Originally Posted by Charr
Ive been trying to add a search funciton to amx_help, but with absolutly no success. I've been tring for over two hours now, and it just won't work. It prints all commands availible to a person, floods the realible channel, or prints several random commands.

I've narrowed down the problem to the contain, because when I use equal in its place, it works fine.
The problem was:
Code:
if(contain(a,b))
Wasn't properly returning all the Information in a for-loop.
Solution:
Code:
if(contain(a,b)!=-1)

And the other problem was:
Code:
len = format(motd,sizeof(motd)-len,"...")
Each line overwrote the line before it in a loop.
Solution:
Code:
len += format(motd[len],sizeof(motd)-len,"...")
__________________
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
 



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 00:03.


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