Raised This Month: $ Target: $400
 0% 

Error printing green chat messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mateo10
Veteran Member
Join Date: Jan 2006
Old 07-07-2007 , 06:33   Error printing green chat messages
Reply With Quote #1

What is wrong with this code?
I know I'm missing something obvious, but I can't find it.
Code:
public print_green(id, const msg[], {Float,Sql,Result_}:...) {     static message[256];     message[0] = 0x04;     vformat(message[1], 251, msg, 4);     message[192] = '^0';     new index, msg_type;     if(!id)     {         index = FindPlayer();         msg_type = MSG_ALL;     }     else     {         index = id;         msg_type = MSG_ONE     }     emessage_begin(msg_type, get_user_msgid("SayText"), _, index);     ewrite_byte(index);     ewrite_string(message);     emessage_end(); } FindPlayer() {     new i = -1;     while(i <= 31)     {         if(is_user_connected(++i))         {             return i;         }     }     return -1; }

Last edited by mateo10; 07-07-2007 at 07:03.
mateo10 is offline
AlMod
Member
Join Date: Nov 2006
Old 07-07-2007 , 12:08   Re: Error printing green chat messages
Reply With Quote #2

in FindPlayer u don't increase "i"
add i++ in while cycle
AlMod is offline
mateo10
Veteran Member
Join Date: Jan 2006
Old 07-07-2007 , 12:18   Re: Error printing green chat messages
Reply With Quote #3

I increase it in if(is_user_connected(++i))
mateo10 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 07-07-2007 , 13:38   Re: Error printing green chat messages
Reply With Quote #4

Code:
vformat(message[1], 251, msg, 4); //to vformat(message[1], 251, msg, 3); while(i <= 31) //to while(i <= 32)
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
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 21:32.


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