AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Unapproved/Old Plugins (https://forums.alliedmods.net/forumdisplay.php?f=27)
-   -   Reset Score (https://forums.alliedmods.net/showthread.php?t=74207)

silentt 07-14-2008 00:33

Reset Score
 
2 Attachment(s)
*Last Updated Post: Saturday, November 11, 2011* - no longer will it display "/resetscore" in the chat when you type the commend and '/rs' is now a chat command to reset the score
This is my first plugin that I am posting up, its a small plugin but I think the idea isnt too bad and somewhat original (the fact that I dont think anyone else has done it yet) and can be useful.

Description
This small plugin allows a player to reset their score back to 0 kills and 0 deaths, this saves them the trouble of reconnecting to your server to reset their score. It makes it easier on them because its a simple command that they would type, and helps your server by not having another person reconnecting and possibly lagging your server.

Client Commands
"say /resetscore" OR "say /restartscore" - This will reset their kills and deaths back to 0

Cvars/Server Commands
(These commands should be put in server.cfg if you want to change them from their defaults)
sv_rsdisplay - (Default 0) If this is set to 1 it will show who resets their score when they reset it
sv_rsadvertise - (Default 0) If this is set to 1 then it will show that this is in your server and tell people how to use it every 10 minuites and when they connect to your server

If you find any bugs please post it or if you have any suggestions feel free to post those too and ill do my best to fix/add them.

*Found a spelling error, and I reposted the fixed version as of Monday July 14 2008*

:: Changelog ::
Version 1.0 ( Monday July 13 2008 )
- Released
Included:
  • Fully working and tested score resetting with counter strike
  • Display cvar (sv_rsdisplay) to turn on/off displaying who uses it and when
  • Advertise cvar (sv_rsadvertise) to turn on/off the advertising of it to let people in the server know its in use and how to use it

Version 1.1 ( Monday July 14 2008 )
- Changed a bit of coding (cvars to pcvars)
- Fixed a spelling error

:: To Do ::
  • Add in an command that allows admins to manually change a players score and then have the addition/deduction of the players score added/removed from their overall server rank - Not Complete

bmann_420 07-15-2008 17:20

Re: Reset Score
 
Good Job, although I'm fully against resetting any scores. :D I wouldnt doubt many people would use this tho.

Bojangles 07-15-2008 17:25

Re: Reset Score
 
Seems solid.

Not something I would use personally but I am sure there are users that would.

silentt 07-16-2008 07:21

Re: Reset Score
 
:D thanks, I don't think many people will use it too. But its nice to use if your one that doesnt like to see bad scores and constantly retries everytime he dies when he didn't want to

JFeldon 07-16-2008 15:39

Re: Reset Score
 
True.

I'm all for, +karma

It's not badly coded either. The only thing is that if you only have a one liner, you don't need brackets.
PHP Code:

if(is_user_connected(id))
    {
    
client_print(idprint_chat"By typing /resetscore at any time during the game, you can reset your deaths and kills back to 0 (rather than reconnecting)")
    } 

is the same as

PHP Code:

if(is_user_connected(id))
        
client_print(idprint_chat"By typing /resetscore at any time during the game, you can reset your deaths and kills back to 0 (rather than reconnecting)"


It doesn't make much difference, it's just a tip if you want to make future plugins even more concise and smaller :D

Nice work though

v3x 07-16-2008 16:26

Re: Reset Score
 
JFeldon: That's all a coder's preference :wink:

silentt: Please use pcvars and I will approve :)

JFeldon 07-17-2008 02:53

Re: Reset Score
 
I know, that's why I said it's just a tip IF you want to do that :P but eh

silentt 07-20-2008 04:28

I switched to pcvar's not sure if I did them right because I never use them. But I re-tested it and it worked so I guess i did. So is the difference that pcvars use variables?

anakin_cstrike 07-20-2008 08:23

Re: Reset Score
 
Hmm...interesting.

silentt 07-21-2008 15:43

Thank you


All times are GMT -4. The time now is 07:03.

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