Raised This Month: $ Target: $400
 0% 

Changing win msgs


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fawkes37
Senior Member
Join Date: Jul 2008
Old 12-30-2008 , 11:10   Changing win msgs
Reply With Quote #1

hello
i am a newbie, i know. but trying to get this done. i admit that i copied the piece of code directly out of Biohazard and have no skills myself.
so basically what im trying to do is change those "Terrorists win!" and so on messages to w/e i want to. but i get the warning that g_winningteam - symbol assigned a value that is never used. i was just trying but i dont think this piece of code would do the job.
so basically what did i do wrong? (btw, this code aint alone, copied it to another plugin.) heres the piece of code:

Code:
new CsTeams:g_winningteam
 
register_message(get_user_msgid("TextMsg"), "msg_textmsg");
 
 
public msg_textmsg(msgid, dest, id)
{
 if(get_msg_arg_int(1) != 4)
  return PLUGIN_CONTINUE
 
 static txtmsg[25], winmsg[32]
 get_msg_arg_string(2, txtmsg, 24)
 
 if(equal(txtmsg[1], "Game_bomb_drop"))
  return PLUGIN_HANDLED
 else if(equal(txtmsg[1], "Terrorists_Win"))
 {
  formatex(winmsg, 31, "%L", LANG_SERVER, "WIN_ZOMBIES")
  set_msg_arg_string(2, winmsg)
 
  g_winningteam = CS_TEAM_T
 }
 else if(equal(txtmsg[1], "Target_Saved") || equal(txtmsg[1], "CTs_Win"))
 {
  formatex(winmsg, 31, "%L", LANG_SERVER, "WIN_SURVIVORS")
  set_msg_arg_string(2, winmsg)
 
  g_winningteam = CS_TEAM_CT
 }
 return PLUGIN_CONTINUE
}
thx
Fawkes37 is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 12-30-2008 , 11:56   Re: Changing win msgs
Reply With Quote #2

Well if its never used just delete it.. U give it a value but u never use it.. so nevermind it

Delete these:

Quote:
new CsTeams:g_winningteam
g_winningteam = CS_TEAM_T
g_winningteam = CS_TEAM_CT
No warrenty however, i didnt look closely at it since its not the whole code...
__________________
Dr.G is offline
Fawkes37
Senior Member
Join Date: Jul 2008
Old 12-30-2008 , 13:53   Re: Changing win msgs
Reply With Quote #3

doesnt really give any warning if i delete this

Code:
register_message(get_user_msgid("TextMsg"), "msg_textmsg");
either. what does that line do and do i need it?
Fawkes37 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 12-30-2008 , 14:26   Re: Changing win msgs
Reply With Quote #4

Quote:
Originally Posted by Fawkes37 View Post
doesnt really give any warning if i delete this

Code:
register_message(get_user_msgid("TextMsg"), "msg_textmsg");
either. what does that line do and do i need it?
It registers the forward with AMXX. Keep it in plugin_init().
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 09:15.


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