Raised This Month: $12 Target: $400
 3% 

[HELP] Score


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
extream87
Senior Member
Join Date: Aug 2011
Old 04-26-2012 , 18:57   [HELP] Score
Reply With Quote #1

Code:
#include <amxmodx> #include <amxmisc> #include <dhudmessage> #define PLUGIN    "Team Score" #define VERSION    "1.0" #define AUTHOR    "BaRSiK" new ct_score, terrorist_score; public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_event("TeamScore", "team_score", "a");     set_task(1.0,"score_round",_,_,_,"b") } public team_score() {     new team[32];     read_data(1,team,31);     if (equal(team,"CT"))     {         ct_score = read_data(2);     }     else if (equal(team,"TERRORIST"))     {         terrorist_score = read_data(2);     } }       public score_round() {     set_dhudmessage(0, 70, 200, -1.0, 0.0, 0, 0.5, 2.0, 0.08, 2.0, true);     show_dhudmessage(0,"Cops:%d|                       ", ct_score);           set_dhudmessage(200, 0, 0, -1.0, 0.0, 0, 0.5, 2.0, 0.08, 2.0, true);     show_dhudmessage(0,"                       |%d:Terrorists", terrorist_score); }
It is possible to maintain the results of rounds after sv_restart 1?

For example:
Code:
if( ++g_iRounds >= 15
save score
extream87 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-27-2012 , 00:17   Re: [HELP] Score
Reply With Quote #2

Code:
public team_score() {     static old_score = 0;     new score = read_data(2) - old_score;         if(score > 0)     {         if(team[0] == 'T')             terrorist_score += score;         else             ct_score += score;     }         old_score = score; }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 04-27-2012 at 11:20.
Exolent[jNr] is offline
nss
Junior Member
Join Date: Feb 2011
Old 04-27-2012 , 06:35   Re: [HELP] Score
Reply With Quote #3

may i ask for adding this to this plugin : keep all player 's score/death when using "sv_restartround 1" ?
nss is offline
extream87
Senior Member
Join Date: Aug 2011
Old 04-27-2012 , 08:13   Re: [HELP] Score
Reply With Quote #4

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <dhudmessage> #define ADMIN_LEVEL ADMIN_IMMUNITY //MUDA SE QUISERES enum Data {     TAG_CT[ 10 ] ,     TAG_T[ 10 ],     nCT,     nT,     nR, } new g_Teamscore[Data]; public plugin_init() {     register_plugin("TeamScore", "1.0", "extream87")         copy(g_Teamscore[TAG_T], 9, "T")     copy(g_Teamscore[TAG_CT], 9, "CT")     register_clcmd( "say", "CmdSay" );     register_clcmd( "say_team ", "CmdSay" );         register_event("SendAudio", "nice_team_score_ct", "a", "2&%!MRAD_ctwin")     register_event("SendAudio", "nice_team_score_t", "a", "2&%!MRAD_terwin")         register_logevent("nice_team_score_round", 2, "1=Round_End")     register_logevent("nice_team_score_reset", 2, "1&Restart_Round_", "1=Game_Commencing")         register_event("HLTV", "nice_team_score_msg", "a", "1=0", "2=0") } public CmdSay(id) {     if (get_user_flags(id) & ADMIN_LEVEL)     {         new szArgs[30], szAgr1[10], szAgr2[10];         read_args( szArgs, charsmax( szArgs ) );         remove_quotes( szArgs );         parse( szArgs, szAgr1, charsmax( szAgr1 ), szAgr2,  charsmax( szAgr2 ) )         if (equal(szAgr1, ".teamct"))             g_Teamscore[TAG_CT] = szAgr2         else if(equal(szAgr1, ".teamtt"))             g_Teamscore[TAG_T] = szAgr2     } } public nice_team_score_msg() {     set_dhudmessage(255, 0, 0, -1.0, 0.03, 0, 0.5, 2.0, 0.08, 3.0, true)     show_dhudmessage(0,"   %s:%d                           ", g_Teamscore[TAG_T], g_Teamscore[nT], g_Teamscore[nR]);         set_dhudmessage(0, 125, 255, -1.0, 0.03, 0, 0.5, 2.0, 0.08, 3.0, true)     show_dhudmessage(0,"                          %d:%s ", g_Teamscore[nCT], g_Teamscore[TAG_CT], g_Teamscore[nR]); } public nice_team_score_ct() {     g_Teamscore[nCT]++ } public nice_team_score_t() {     g_Teamscore[nT]++ } public nice_team_score_round() {     g_Teamscore[nR]++ } public nice_team_score_reset() {     g_Teamscore[nCT] = 0         g_Teamscore[nT] = 0         g_Teamscore[nR] = 0 }
Exolent[jNr] can you edit this with: Maintain the results of rounds after sv_restart 1?

Last edited by extream87; 04-27-2012 at 08:20.
extream87 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-27-2012 , 11:17   Re: [HELP] Score
Reply With Quote #5

Remove this:
Code:
register_logevent("nice_team_score_reset", 2, "1&Restart_Round_", "1=Game_Commencing")
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 04-27-2012 , 11:20   Re: [HELP] Score
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
Code:
public team_score() {     static old_score = 0;     new score = read_data(2) - old_score;         if(score > 0)     {         if(team[0] == 'T')             terrorist_score += score;         else             ct_score += score;     } }
You never update old_score ?
__________________
Retired.
Xalus is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-27-2012 , 11:21   Re: [HELP] Score
Reply With Quote #7

Quote:
Originally Posted by Xalus View Post
You never update old_score ?
Yep, forgot about it.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
extream87
Senior Member
Join Date: Aug 2011
Old 04-27-2012 , 12:32   Re: [HELP] Score
Reply With Quote #8

Exolent[jNr] If I remove it to give live and one player is afk the round will continue counting from 1 rather than 0
Code:
register_logevent("nice_team_score_reset", 2, "1&Restart_Round_", "1=Game_Commencing")

Last edited by extream87; 04-27-2012 at 12:32.
extream87 is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-27-2012 , 17:26   Re: [HELP] Score
Reply With Quote #9

Then change
Code:
register_logevent("nice_team_score_reset", 2, "1&Restart_Round_", "1=Game_Commencing")
to
Code:
register_logevent("nice_team_score_reset", 2, "1=Game_Commencing")
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
extream87
Senior Member
Join Date: Aug 2011
Old 04-27-2012 , 18:32   Re: [HELP] Score
Reply With Quote #10

That is equal if i do .rr the score no reset.

Example: 1st half the result is 8-7 an in the 2nd round if you are already 10-7 type sv_restart 1 the result back to 8-7
extream87 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 09:18.


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