Raised This Month: $ Target: $400
 0% 

[CS] Which team won? (get at end of round) *SOVED*


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrOpposite
Junior Member
Join Date: Jul 2009
Location: Sverige FTW
Old 07-27-2009 , 18:13   [CS] Which team won? (get at end of round) *SOVED*
Reply With Quote #1

This is my second question, now I created a bet-script, so it works as it should when you place the bets.

But then I went into a problem. When the round ends, I'd like to know which team won, CT or T. I haven't found a function for this. This is the last thing I need to know before finishing the script

EDIT:
I got the round change using this:
PHP Code:
register_event("HLTV","roundchange","a"); 
If that helps...

Last edited by MrOpposite; 07-28-2009 at 07:40. Reason: Added more info
MrOpposite is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-27-2009 , 18:24   Re: [CS] Which team won? (get at end of round)
Reply With Quote #2

One way :

Code:
register_event( "SendAudio", "Event_TerrorstWin", "a", "2&%!MRAD_terwin" ); register_event( "SendAudio", "Event_CTWin", "a", "2&%!MRAD_ctwin"  );

or

Code:
register_event( "TextMsg", "Event_TerroristWin", "a", "2=#Terrorists_Win" ); register_event( "TextMsg", "Event_CTWin", "a", "2=#CT_Win" );
__________________

Last edited by Arkshine; 07-27-2009 at 18:28.
Arkshine is offline
MrOpposite
Junior Member
Join Date: Jul 2009
Location: Sverige FTW
Old 07-27-2009 , 18:26   Re: [CS] Which team won? (get at end of round)
Reply With Quote #3

I'll use that for now, but on certain mods the audio is disabled, and the "Counter-Terrorist wins" (nor the "Terrorist wins") sound is not played. (I'd like this to be compatible with as many mods as possible )
MrOpposite is offline
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 07-27-2009 , 18:44   Re: [CS] Which team won? (get at end of round)
Reply With Quote #4

You can do that with messages (messages are called before the events) and put plugin's name above the custom plugin names in plugins.ini.
Code:
#include <amxmodx>   public plugin_init()         register_message(get_user_msgid("TextMsg"), "TextMsg");   public TextMsg() {         new Text[32];         get_msg_arg_string(2, Text, 31);           if (equal(Text, "#Terrorists_Win"))         {                 // Terrorists have won         }         else if (equal(Text, "#CTs_Win"))         {                 // CTs have won         }         else if (equal(Text, "#Round_Draw")) // Should work         {                 // Round draw         } }
__________________

Last edited by hleV; 07-27-2009 at 18:52.
hleV is offline
MrOpposite
Junior Member
Join Date: Jul 2009
Location: Sverige FTW
Old 07-27-2009 , 18:47   Re: [CS] Which team won? (get at end of round)
Reply With Quote #5

Ok, thanks you two, But I ran into a problem... What about "round draw"? Whats the sound thingi for that?
MrOpposite is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 07-27-2009 , 18:53   Re: [CS] Which team won? (get at end of round)
Reply With Quote #6

He edited
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
MrOpposite
Junior Member
Join Date: Jul 2009
Location: Sverige FTW
Old 07-27-2009 , 18:59   Re: [CS] Which team won? (get at end of round)
Reply With Quote #7

Oh I see, Thanks all. Now I think the script is working perfectly! (Gonna test it along with a zombie-mod to see if it works)

The only thing left to do is commenting, (I haven't got the habit of doing that when scripting, I do it after )
MrOpposite is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 07-27-2009 , 19:04   Re: [CS] Which team won? (get at end of round)
Reply With Quote #8

kk, are you going to release it?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-27-2009 , 19:07   Re: [CS] Which team won? (get at end of round)
Reply With Quote #9

Log event ( I would not use register_message )

Code:
register_logevent( "Event_CTWin"       , 6, "3=CTs_Win"       , "3=All_Hostages_Rescued" ); register_logevent( "Event_TerroristWin", 6, "3=Terrorists_Win", "3=Target_Bombed" );
__________________

Last edited by Arkshine; 07-27-2009 at 19:12.
Arkshine is offline
MrOpposite
Junior Member
Join Date: Jul 2009
Location: Sverige FTW
Old 07-28-2009 , 04:37   Re: [CS] Which team won? (get at end of round)
Reply With Quote #10

Quote:
Originally Posted by TitANious View Post
kk, are you going to release it?
Yes, when I've tested it some more with my friends... When I test it myself I only get "Round Draw" and that works... But the other events are untested

Quote:
Originally Posted by Arkshine View Post
Log event ( I would not use register_message )

Code:
register_logevent( "Event_CTWin"       , 6, "3=CTs_Win"       , "3=All_Hostages_Rescued" ); register_logevent( "Event_TerroristWin", 6, "3=Terrorists_Win", "3=Target_Bombed" );
Oh, that would be awesome, is it possible to remove "3=Target_Bombed" and "3=All_Hostages_Rescued" to make it trigger for CT victory when the bomb is not blown, or all T are killed?
MrOpposite is offline
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 18:23.


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