Raised This Month: $114 Target: $400
 28% 

No Reset Score


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Gameplay        Approver:   Hawk552 (427)
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 03-01-2010 , 17:44   No Reset Score
Reply With Quote #1

No Reset Score

Version: 1.2

Descripcion:
The score doesn't reset with sv_restart & sv_restartround

Changelog:
1.0 - first release
1.1 - fix a bit the code... thanks exolent
1.2 - improved plugin... thanks Connor (L)

PD: if you know any other name more shortly, please tell me
Attached Files
File Type: sma Get Plugin or Get Source (noresetscore.sma - 3444 views - 1.3 KB)
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).


Last edited by gladius; 03-04-2010 at 19:01.
gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 03-01-2010 , 17:56   Re: Don't reset score with sv_restart
Reply With Quote #2

1. Check if player is connected before getting frags and deaths.

2. A player could have a negative frags from killing a teammate.
Code:
if(Frags[user] || Deaths[user])

3. If player disconnects, remove the save variable.

4. When player spawn, check if alive first.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-01-2010 , 18:10   Re: Don't reset score with sv_restart
Reply With Quote #3

Isn't it bad for a file to have spaces in the name?

I know it can cause file corruption in Adobe Illustrator files ( learned that the hard way in Comp. Graphics class... ).
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 03-01-2010 , 18:15   Re: Don't reset score with sv_restart
Reply With Quote #4

Quote:
Originally Posted by Exolent[jNr] View Post
1. Check if player is connected before getting frags and deaths.

2. A player could have a negative frags from killing a teammate.
Code:
if(Frags[user] || Deaths[user])


3. If player disconnects, remove the save variable.

4. When player spawn, check if alive first.
1. ok
2. ok
3. ok
4. ok

thanks
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 03-01-2010 , 21:29   Re: Don't reset score with sv_restart
Reply With Quote #5

Quote:
Originally Posted by gladius View Post
PD: if you know any other name more shortly, please tell me
You can't tell me you couldn't think of something smaller and more friendly. Try norestetscores.sma
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (intervening in a thread, asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
gladius
Veteran Member
Join Date: Jul 2008
Location: Santiago, Chile
Old 03-01-2010 , 21:32   Re: Don't reset score with sv_restart
Reply With Quote #6

thx yamikaitou (L)
__________________
Proyects
Kreedz Chile Mod [100%] (Fixing some details).

gladius is offline
Send a message via MSN to gladius Send a message via Skype™ to gladius
benamo6
Veteran Member
Join Date: Aug 2008
Location: NeverLand
Old 03-01-2010 , 21:41   Re: No Reset Score
Reply With Quote #7

Really nice idea, could you add a feature so timeleft doesnt reset?
And I suggest you to add a command to deactivate/activate the plugin, so if you want to reset score you will be able to do it.

[ES] Copada idea, le podrias agregar para que no resetee el tiempo que falta para cambiar de mapa.
Tambien te recomiendo agregar una cvar para activar/desactivarlo asi si queres resetear el score podes.
__________________
Please help me with this Thread
I am 70% addicted to Counterstrike. What about you?
Ill make any spanish translation of a plugin. Just ask for it
benamo6 is offline
Send a message via MSN to benamo6
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-02-2010 , 02:07   Re: No Reset Score
Reply With Quote #8

There is absolutely no need to use register_message, use register_event instead.

Also, if restart is like 20 seconds later, people may have time to make frags, to die, even some players can spawn before the round restart, you may improve your plugin.
__________________
- tired and retired -
ConnorMcLeod is offline
TucanN#
Veteran Member
Join Date: May 2009
Location: Argentina, Mendoza
Old 03-03-2010 , 16:03   Re: No Reset Score
Reply With Quote #9

thanks!

credits: TucanN# (IDEA)
TucanN# is offline
Send a message via MSN to TucanN#
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-03-2010 , 19:46   Re: No Reset Score
Reply With Quote #10

Ok i made some research and this is what you should do :

1. Register the #Game_will_restart_in TextMsg as an event
2. In the event callBack set a global bool so you know later that the game is restarting

3. Register NewRound with HLTV event
4. In new round event, if the game is restarting, save gametime and save scores, because HLTV event is triggerer right before player spawn and scores are reseted in player spawn, or between HLTV event and Player Spawn, but all of this is procceded in the same frame and that is usefull for #6.

5. Register Spawn event with Ham (you could even enable it in HLTV event and disabled it later)
6. When a player spawn, if the gametime is the saved gametime, restore player score, if gametime doesn't match, unregister Spawn.
__________________
- tired and retired -

Last edited by ConnorMcLeod; 03-03-2010 at 20:31.
ConnorMcLeod 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 12:01.


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