View Single Post
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 01-11-2013 , 05:46   Re: [CS:GO/CSS] AbNeR ResetScore
Reply With Quote #3

Looks useful.

Your indentation, though, is...well...all over the place. Dunno how else to describe it.
PHP Code:
public Action:CommandResetScore(idargs)
{                        
                
decl String:theFolder[40];
                
GetGameFolderName(theFoldersizeof(theFolder)); 
That's a lot of spacing you've got, there.
PHP Code:
new target FindTarget(clientarg1);
    if (
target == -1)
    {
          
PrintToChat(client"\x01[ResetScore] Invalid Player."); 
              return 
Plugin_Handled;
    }

        if (!
IsClientInGame(target))
        {
              
PrintToChat(client"\x01[ResetScore] Invalid Player.");   
              return 
Plugin_Handled;
        } 
A few indentation inconsistencies there.

If you're using Notepad++, hit TextFX in the menu bar -> TextFX Edit -> Reindent C++ code, and it'll all be neatened up for you.

Also, in the CommandResetPlayer command, you ought to steal a ProcessTargetString snippet from another plugin (like fire.sp in funcommands, for instance) and use that instead of FindTarget. That way you can also avoid using GetClientName, and instead use a target_name variable which it fills out. Also, ShowActivity2 instead of PrintToChatAll is preferred, especially for servers with admin names hidden or activity messages disabled.

One "gameplay"-related thing I'd like to point out: if players can just die without getting any kills, then reset their deaths (from 0:1 to 0:0) isn't that...bad?
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline