Raised This Month: $32 Target: $400
 8% 

How to use the TextMsg message?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
kof2000k
Junior Member
Join Date: Jan 2008
Old 01-20-2008 , 21:49   How to use the TextMsg message?
Reply With Quote #1

PHP Code:
public plugin_init()
{
    
register_plugin("OMFG","HAX","LOL")
 
    
register_event("TextMsg","Cmdmsg","1=#Game_join_ct")
}
public 
Cmdmsg()
{
    
console_print(1,"run")
    
message_begin(MSG_ALLget_user_msgid("TextMsg"), {0,0,0}, 0)
    
write_byte(2)
    
write_string("#Game_join_ct")
    
write_string("Pimp Daddy")
    
message_end()
    return 
PLUGIN_HANDLED

The param 1 "#Game_join_ct" is not a message,but it is like a message.What is it?How many type for it?Where can i know more about the usage of "TextMsg".Thanks for help!

Last edited by kof2000k; 01-20-2008 at 21:52.
kof2000k is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-20-2008 , 22:32   Re: How to use the TextMsg message?
Reply With Quote #2

They are preformated text.

e.g: #Terrorists_Win or #CTs_Win are centered text displayed when terrorist win or Ct wins.

First argument is the type. Same as client_print() function.

Quote:
/* Destination types for client_print() */
enum {
print_notify = 1,
print_console,
print_chat,
print_center,
};
I don't know if there is a list but you can log messages by yourself.

Code:
    public plugin_init()     {         register_plugin( "", "", "" );         register_event( "TextMsg", "eTextMsg", "a" );     }     public eTextMsg()     {         new iType = read_data( 1 );                   new sMessage[32];         read_data( 2, sMessage, charsmax( sMessage ) );                 new sName[32];         read_data( 3, sName, charsmax( sName ) );                 log_amx( "iType = %d | sMessage = '%s' | sName = '%s'", iType, sMessage, sName );     }
__________________
Arkshine is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-20-2008 , 23:17   Re: How to use the TextMsg message?
Reply With Quote #3

actually the first argument of client_print is to whom to send... 0 for all players and 1-32 to a specific player.... after that you can put print_chat/center/notify/whatever, ex:
PHP Code:
client_print(0,print_chat,"Sent to all players !"); 
__________________
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-20-2008 , 23:35   Re: How to use the TextMsg message?
Reply With Quote #4

Quote:
Originally Posted by Hunter-Digital View Post
actually the first argument of client_print is to whom to send... 0 for all players and 1-32 to a specific player.... after that you can put print_chat/center/notify/whatever, ex:
PHP Code:
client_print(0,print_chat,"Sent to all players !"); 
You are out of topic...

We are speaking about TextMsg event, and the first argument is the type of message.

http://wiki.alliedmods.net/Half-Life...Events#TextMsg
__________________
Arkshine is offline
kof2000k
Junior Member
Join Date: Jan 2008
Old 01-21-2008 , 01:12   Re: How to use the TextMsg message?
Reply With Quote #5

OH,thanks,but logging messages for a list is a huge job...
kof2000k is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-21-2008 , 05:35   Re: How to use the TextMsg message?
Reply With Quote #6

Not as hudge as you think, considering you can use a plugin that will do it for you, as msg_logging or shptool
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 01-21-2008 , 06:14   Re: How to use the TextMsg message?
Reply With Quote #7

Just a raw list... It's not by any means complete nor cleaned up ( you may find that the logevent or sendaudio are misplaced ).
Code:
#C4_Arming_Cancelled
#Bomb_Planted					"%s<%i><%s><TERRORIST>" triggered "Planted_The_Bomb"
#C4_Plant_Must_Be_On_Ground
#C4_Plant_At_Bomb_Spot
#Switch_To_FullAuto
#Switch_To_BurstFire
#Fire_in_the_hole				%!MRAD_FIREINHOLE
#Switch_To_SemiAuto
#CZero_LearningMap
#CZero_AnalyzingHidingSpots
#CZero_AnalyzingApproachPoints
						"%s<%i><%s><CT>" triggered "Rescued_A_Hostage"
#Hint_careful_around_hostages
#Injured_Hostage
#Hint_removed_for_next_hostage_killed
#Hint_lost_money
#Killed_Hostage					"%s<%i><%s><%s>" triggered "Killed_A_Hostage"
#Only_CT_Can_Move_Hostages			"%s<%i><%s><CT>" triggered "Touched_A_Hostage"
#Game_disconnected
#Game_kicked
#Game_connected					"%s<%i><%s><%s>" %s "%s"%s
#Cstrike_Chat_AllSpec				*SPEC* %s : %s
#Cstrike_Chat_AllDead				*DEAD* %s : %s
#Cstrike_Chat_All				%s : %s
#Cstrike_Chat_Spec				(Spectator) %s : %s
#Cstrike_Chat_T_Dead				*DEAD*(Terrorist) %s : %s
#Cstrike_Chat_T					(Terrorist) %s : %s
#Cstrike_Chat_T_Loc				(Terrorist) %s @ %s : %s
#Cstrike_Chat_CT_Dead				*DEAD*(Counter-Terrorist) %s : %s
#Cstrike_Chat_CT				(Counter-Terrorist) %s : %s
#Cstrike_Chat_CT_Loc				(Counter-Terrorist) %s @ %s : %s
#Cannot_Buy_This
#Cstrike_Already_Own_Weapon
#Not_Enough_Money
#Hint_use_nightvision
#Already_Have_One
#Cannot_Carry_Anymore
#Already_Have_Kevlar_Bought_Helmet
#Already_Have_Kevlar_Helmet
#Already_Have_Helmet_Bought_Kevlar
#Already_Have_Kevlar
						"%s<%i><%s><%s>" joined team "SPECTATOR"
#Cannot_Be_Spectator
#Game_join_ct					"%s<%i><%s><%s>" joined team "%s"
#Game_join_terrorist				"%s<%i><%s><%s>" joined team "%s"
#Terrorist_Select
#CT_Select
#Only_1_Team_Change
#Humans_Join_Team_T
#Humans_Join_Team_CT
#Too_Many_CTs
#Too_Many_Terrorists
#All_Teams_Full
#CTs_Full
#Terrorists_Full
#Cannot_Switch_From_VIP
#Taking_fire					%!MRAD_HITASSIST
#Follow_me					%!MRAD_FOLLOWME
#Regroup_team					%!MRAD_REGROUP
#Hold_this_position				%!MRAD_POSITION
#You_take_the_point				%!MRAD_TAKEPOINT
#Cover_me					%!MRAD_COVERME
#Report_in_team					%!MRAD_REPORTIN
#Storm_the_front				%!MRAD_STORMFRONT
#Get_in_position_and_wait			%!MRAD_GETINPOS
#Stick_together_team				%!MRAD_STICKTOG
#Team_fall_back					%!MRAD_FALLBACK
#Go_go_go					%!MRAD_GO
#Enemy_down					%!MRAD_ENEMYDOWN
#Negative					%!MRAD_NEGATIVE
#Get_out_of_there				%!MRAD_BLOW
#Reporting_in					%!MRAD_REPRTINGIN
#In_position					%!MRAD_INPOS
#Sector_clear					%!MRAD_CLEAR
#Need_backup					%!MRAD_BACKUP
#Enemy_spotted					%!MRAD_ENEMYSPOT
#Roger_that					%!MRAD_ROGER
#Affirmative					%!MRAD_AFFIRM
#Alias_Not_Avail
#TactShield_Desc
#Bomb_Defusal_Kit
#Game_unknown_command
#Buy
#RadioC
#RadioB
#RadioA
#Command_Not_Available
#Accept_Radio
#Ignore_Radio
#Accept_All_Messages
#Ignore_Broadcast_Team_Messages
#Ignore_Broadcast_Messages
#IG_Team_Select_Spect
#IG_VIP_Team_Select_Spect
#IG_VIP_Team_Select
#T_BuyItem
#CT_BuyItem
#DT_BuyItem
#DCT_BuyItem
#BuyMachineGun
#AS_T_BuyMachineGun
#T_BuyRifle
#CT_BuyRifle
#AS_T_BuyRifle
#AS_CT_BuyRifle
#T_BuySubMachineGun
#CT_BuySubMachineGun
#AS_T_BuySubMachineGun
#AS_CT_BuySubMachineGun
#BuyShotgun
#AS_BuyShotgun
#T_BuyPistol
#CT_BuyPistol
#IG_Team_Select
#Team_Select
#Game_no_timelimit
#Game_timelimit
#Game_voted_for_map
#Cannot_Vote_Need_More_People
#Game_votemap_usage
#Cannot_Vote_Map
#Wait_3_Seconds
#Game_vote_cast
#Game_vote_not_yourself
#Game_vote_players_on_your_team
#Game_vote_player_not_found
#Cannot_Vote_With_Less_Than_Three
#Game_vote_usage
#Cstrike_Name_Change				"%s<%i><%s><%s>" changed name to "%s"
#Name_change_at_respawn
#Defusing_Bomb_Without_Defuse_Kit		"%s<%i><%s><CT>" triggered "Begin_Bomb_Defuse_Without_Kit"
#Defusing_Bomb_With_Defuse_Kit			"%s<%i><%s><CT>" triggered "Begin_Bomb_Defuse_With_Kit"
#C4_Defuse_Must_Be_On_Ground
						World triggered "%s" (CT "%i") (T "%i")
						World triggered "Round_End"
						Team "%s" triggered "%s" (CT "%i") (T "%i")
#Hint_you_have_the_bomb				"%s<%i><%s><TERRORIST>" triggered "Spawned_With_The_Bomb"
#All_Hostages_Rescued
#Round_Draw
#Terrorists_Win
#CTs_Win
#Bomb_Defused					"%s<%i><%s><CT>" triggered "Defused_The_Bomb"
#Target_Bombed
#Escaping_Terrorists_Neutralized
#CTs_PreventEscape
#Terrorists_Escaped
#VIP_Assassinated
#VIP_Escaped
#Game_Commencing				World triggered "Game_Commencing"
#Game_scoring
#Auto_Team_Balance_Next_Round
#All_VIP_Slots_Full
#Game_added_position
#Game_in_position
#Game_will_restart_in_console
#Game_will_restart_in
						Team "TERRORIST" scored "%i" with "%i" players
						Team "CT" scored "%i" with "%i" players
						World triggered "Restart_Round_(%i_%s)"
#VIP_Not_Escaped
#Terrorists_Not_Escaped
#Hostages_Not_Rescued
#Target_Saved
						%!MRAD_VIP
						%!MRAD_GETOUT
						%!MRAD_ELIM
						%!MRAD_MOVEOUT
						%!MRAD_LETSGO
						%!MRAD_LOCKNLOAD
						World triggered "Round_Start"
						"%s<%i><%s><>" entered the game
						"%s<%i><%s><%s>" disconnected
#Team_Select_Spect
#Hint_win_round_by_killing_enemy
						"%s<%i><%s><TERRORIST>" triggered "Assassinated_The_VIP"
#Hint_reward_for_killing_vip
#Hint_careful_around_teammates
#Banned_For_Killing_Teamates
#Game_teammate_kills
#Killed_Teammate
						"%s<%i><%s><%s>" committed suicide with "%s" (world)
						"%s<%i><%s><%s>" killed "%s<%i><%s><%s>" with "%s"
						"%s<%i><%s><%s>" committed suicide with "%s"
#Map_Vote_Extend
#Votes
#Vote
#Game_required_votes
#Spec_Mode%i
#Spec_NoTarget
#Game_radio_location
#Game_radio
						"%s<%i><%s><%s>" attacked "%s<%i><%s><%s>" with "%s" (damage "%d") (damage_armor "%d") (health "%d") (armor "%d")
#Game_teammate_attack
#Hint_try_not_to_injure_teammates
#Spec_Duck
#Hint_cannot_play_because_tk
						"%s<%i><%s><CT>" triggered "Became_VIP"
#Hint_use_hostage_to_stop_him
#Hint_lead_hostage_to_rescue_point
#Terrorist_cant_buy
#CT_cant_buy
#VIP_cant_buy
#Cant_buy
#Hint_press_buy_to_purchase
#Game_idle_kick					"%s<%i><%s><%s>" triggered "Game_idle_kick" (auto)
#Hint_you_are_the_vip
#Hint_hostage_rescue_zone
#Hint_you_are_in_targetzone
#Hint_terrorist_escape_zone
#Hint_terrorist_vip_zone
#Hint_ct_vip_zone
#Hint_out_of_ammo
#Hint_press_use_so_hostage_will_follow
#Hint_prevent_hostage_rescue
#Hint_rescue_the_hostages
#Hint_spotted_a_friend
#Hint_spotted_an_enemy
#Game_bomb_drop					"%s<%i><%s><TERRORIST>" triggered "Dropped_The_Bomb"
#Weapon_Cannot_Be_Dropped
#Game_join_ct_auto				"%s<%i><%s><%s>" joined team "%s" (auto)
#Game_join_terrorist_auto			"%s<%i><%s><%s>" joined team "%s" (auto)
#Terrorist_Escaped				"%s<%i><%s><TERRORIST>" triggered "Terrorist_Escaped"
						"%s<%i><%s><CT>" triggered "Escaped_As_VIP"
#Game_bomb_pickup				"%s<%i><%s><TERRORIST>" triggered "Got_The_Bomb"
#Got_bomb
#CZero_Tutor_Turned_Off
#CZero_Tutor_Turned_On
#Cstrike_TutorState_Waiting_For_Start
#Cstrike_TutorState_Buy_Time
#Cstrike_TutorState_Running_Away_From_Ticking_Bomb
#Cstrike_TutorState_Looking_For_Loose_Bomb
#Cstrike_TutorState_Guarding_Bomb
#Cstrike_TutorState_Planting_Bomb
#Cstrike_TutorState_Moving_To_Bomb_Site
#Cstrike_TutorState_Escorting_Bomb_Carrier
#Cstrike_TutorState_Attacking_Hostage_Escort
#Cstrike_TutorState_Looking_For_Hostage_Escort
#Cstrike_TutorState_Moving_To_Intercept_Enemy
#Cstrike_TutorState_Guarding_Hostage
#Cstrike_TutorState_Defusing_Bomb
#Cstrike_TutorState_Guarding_Loose_Bomb
#Cstrike_TutorState_Looking_For_Bomb_Carrier
#Cstrike_TutorState_Moving_To_Bombsite
#Cstrike_TutorState_Following_Hostage_Escort
#Cstrike_TutorState_Escorting_Hostage
#Cstrike_TutorState_Looking_For_Hostage
#Cstrike_TutorState_Undefined
_Master_ is offline
Reply


Thread Tools
Display Modes

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 02:01.


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