AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Changing win msgs (https://forums.alliedmods.net/showthread.php?t=82809)

Fawkes37 12-30-2008 11:10

Changing win msgs
 
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

Dr.G 12-30-2008 11:56

Re: Changing win msgs
 
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...

Fawkes37 12-30-2008 13:53

Re: Changing win msgs
 
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?

Hawk552 12-30-2008 14:26

Re: Changing win msgs
 
Quote:

Originally Posted by Fawkes37 (Post 735619)
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().


All times are GMT -4. The time now is 09:15.

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