Raised This Month: $ Target: $400
 0% 

How works Team_Info?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 05-18-2009 , 05:27   How works Team_Info?
Reply With Quote #1

Help please. I can't understand how works Team_Info. When I send message to all players after setting TeamInfo to Terrorist then sometimes players receives message with blue text.
How correctly to change TeamInfo?

message_begin(MSG_ONE,get_user_msgid("TeamInf o"),_,id);
write_byte(id); //what here to write?
write_string("TERRORIST");
message_end();

i can't understand differing MSG_ALL from MSG_ONE and differing "id" in message_begin from "id" in write_byte.

Last edited by -=hunter=-; 05-18-2009 at 08:13.
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 05-18-2009 , 08:12   Re: How works Team_Info?
Reply With Quote #2

Somebody can explain this differences?
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-18-2009 , 08:55   Re: How works Team_Info?
Reply With Quote #3

MSG_ALL or MSG_BROADCAST will sent the message for all connected players.

MSG_ONE or MSG_UNRELIABLE will sent the message only for the player's id provided in message_begin().

The first write_byte() is to specify the player's id you want to change teaminfo.
Arkshine is offline
-=hunter=-
Senior Member
Join Date: Jul 2008
Old 05-19-2009 , 01:46   Re: How works Team_Info?
Reply With Quote #4

arkshine
Thank you.

I have experimented with a code (below) and have understood because of what there was a problem:

Code:
message_begin(MSG_ALL, get_user_msgid("TeamInfo"));
write_byte(2);
write_string("CT");
message_end();
	
message_begin(MSG_ONE,get_user_msgid("SayText"),_,1);
write_byte(2);
write_string("^x03hello^x01"); // Message will be with blue colour text
message_end();

message_begin(MSG_ALL, get_user_msgid("TeamInfo"));
write_byte(2);
if (team==1) write_string("TERRORIST");
else write_string("CT");
message_end();
If to use
Code:
message_begin(MSG_ALL, get_user_msgid("TeamInfo"));
then necessary to send message "^x03hello^x01" with type MSG_ALL
otherwise player1 will receive message with initial team colour of player2.

In this case its necessary to use each time TeamInfo on each player .
-=hunter=- is offline
Send a message via ICQ to -=hunter=- Send a message via Skype™ to -=hunter=-
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 11:21.


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