Review for Approval Status: Pending Feature Additions / Code Correction
Your plugin currently does not provide any features that are not already available by existing plugins: Exvel's Save Scores and tuty's Resetscore. The former provides saving scores, saving cash, multiple games, etc, while the latter is CS:S specific that provides the core functionality with no fluff.
You do not need to attach random images such as a cookie for a plugin thread...
Now as for your coding:
While not required, it's usually a good idea to prefix your variables with their type. For example, you already use "g_" to signify global, and "h" for handles, albeit your usage is hit/miss. You can prefix integers with i, floats with f, b for bools, and strings with s to make your code easier to read. iResets, fTimeleft, and sResets allow you to easily see what type a variable is.
You declare "resets" to 64 characters, when it's an integer that is with in the single digits. resets[2] or resets[3] would be more desirable (why declare 62 other characters if they're never used?)
Your usage of ConVarChanged is incorrect as well as inefficient - there's no reason to update all variables when ConVarChanged only changes one convar at a time.
You should never pass a client index within a trigger: instead use their userid or serial and get the new value within the Timer. This ensures a new client doesn't inherit a previous client's timer. Alternatively, you can create an array of Handles per client and kill the timer when the client disconnects.
__________________
Last edited by thetwistedpanda; 08-15-2012 at 13:32.
Review for Approval Status: Pending Feature Additions / Code Correction
Your plugin currently does not provide any features that are not already available by existing plugins: Exvel's Save Scores and tuty's Resetscore. The former provides saving scores, saving cash, multiple games, etc, while the latter is CS:S specific that provides the core functionality with no fluff.
You do not need to attach random images such as a cookie for a plugin thread...
Now as for your coding:
While not required, it's usually a good idea to prefix your variables with their type. For example, you already use "g_" to signify global, and "h" for handles, albeit your usage is hit/miss. You can prefix integers with i, floats with f, b for bools, and strings with s to make your code easier to read. iResets, fTimeleft, and sResets allow you to easily see what type a variable is.
You declare "resets" to 64 characters, when it's an integer that is with in the single digits. resets[2] or resets[3] would be more desirable (why declare 62 other characters if they're never used?)
Your usage of ConVarChanged is incorrect as well as inefficient - there's no reason to update all variables when ConVarChanged only changes one convar at a time.
You should never pass a client index within a trigger: instead use their userid or serial and get the new value within the Timer. This ensures a new client doesn't inherit a previous client's timer. Alternatively, you can create an array of Handles per client and kill the timer when the client disconnects.
Done
Quote:
2.0 -
Anything here.
Stopped using cookies.
New cvar.
I have no idea why I made the plugin to work with CS:S only, so lets go with all games!
Now everybody will be able to read this scarmbled code :S
While it's awesome that you fixed the suggestions, this still wont be approved as it's a dupe of currently approved plugins - while choice is good, fracturing the user base isn't.
While it's awesome that you fixed the suggestions, this still wont be approved as it's a dupe of currently approved plugins - while choice is good, fracturing the user base isn't.
It have many features that other plugins don't have.
It can give the user the resets that he used back after defined time, advantage for admins and much more that I can add soon.
It have many features that other plugins don't have.
It can give the user the resets that he used back after defined time, advantage for admins and much more that I can add soon.
That's a non-feature, people will just rejoin the server if they run out of resets and want to reset their score.
new Handle:g_hEnabled = INVALID_HANDLE, Handle:g_hTimerMsg = INVALID_HANDLE, Handle:g_hTimer = INVALID_HANDLE;
new bool:g_bEnabled = false, bool:g_bSayHook = false;
new Float:g_fTimer;
public Plugin:myinfo = { name = "Reset Score", author = PLUGIN_AUTHOR, description = "Type !resetscore in chat to reset your score.", version = PLUGIN_VERSION, url = "www.ligs.us" };
new Handle:g_hEnabled = INVALID_HANDLE, Handle:g_hTimerMsg = INVALID_HANDLE, Handle:g_hTimer = INVALID_HANDLE;
new bool:g_bEnabled = false, bool:g_bSayHook = false;
new Float:g_fTimer;
public Plugin:myinfo = { name = "Reset Score", author = PLUGIN_AUTHOR, description = "Type !resetscore in chat to reset your score.", version = PLUGIN_VERSION, url = "www.ligs.us" };