AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   No Reset Score (https://forums.alliedmods.net/showthread.php?t=120192)

gladius 03-01-2010 16:44

No Reset Score
 
1 Attachment(s)
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

Exolent[jNr] 03-01-2010 16:56

Re: Don't reset score with sv_restart
 
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.

wrecked_ 03-01-2010 17:10

Re: Don't reset score with sv_restart
 
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... ).

gladius 03-01-2010 17:15

Re: Don't reset score with sv_restart
 
Quote:

Originally Posted by Exolent[jNr] (Post 1104738)
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

YamiKaitou 03-01-2010 20:29

Re: Don't reset score with sv_restart
 
Quote:

Originally Posted by gladius (Post 1104725)
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

gladius 03-01-2010 20:32

Re: Don't reset score with sv_restart
 
thx yamikaitou (L)

benamo6 03-01-2010 20:41

Re: No Reset Score
 
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.

ConnorMcLeod 03-02-2010 01:07

Re: No Reset Score
 
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.

TucanN# 03-03-2010 15:03

Re: No Reset Score
 
thanks!

credits: TucanN# (IDEA) :P

ConnorMcLeod 03-03-2010 18:46

Re: No Reset Score
 
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.


All times are GMT -4. The time now is 14:38.

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