AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:S] Resetscore (https://forums.alliedmods.net/showthread.php?t=96270)

tuty 07-02-2009 20:59

[CS:S] Resetscore
 
1 Attachment(s)


Reset Score



[IMG]http://img196.**************/img196/4317/about1q.jpg[/IMG]
Description:

This 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.




[IMG]http://img20.**************/img20/2184/settings3.png[/IMG] Cvars:

- sm_resetscore: 0 - disable / 1 - enable plugin




[IMG]http://img20.**************/img20/2184/settings3.png[/IMG] Commands:

Say or SayTeam:

- !resetscore - reset your score to 0
- !restartscore -
reset your score to 0



.

fezh 07-02-2009 21:02

Re: [CS:S] Resetscore
 
Code:

        SetClientFrags( id, 0 );
        SetClientFrags( id, 0 );
        SetClientDeaths( id, 0 );
        SetClientDeaths( id, 0 );

Why two times? o.o

tuty 07-02-2009 21:04

Re: [CS:S] Resetscore
 
These both NEED to be done twice, otherwise your frags wont be reseted until the next round

Greyscale 07-03-2009 04:16

Re: [CS:S] Resetscore
 
Quote:

Originally Posted by tuty (Post 862868)
These both NEED to be done twice, otherwise your frags wont be reseted until the next round

I've never seen that happen.. weird.

exvel 07-03-2009 11:12

Re: [CSS] Resetscore
 
Something like this was included in my savescores plugin with using clientprefs menu but I am glad to see this as separate plugin. :)

exvel 07-03-2009 11:21

Re: [CS:S] Resetscore
 
Quote:

Originally Posted by Greyscale (Post 863014)
I've never seen that happen.. weird.

I think this is because for some reason changes are not networked. The clearest way is to rewrite this default functions with using SetEntData and setting changeState=true.

nematu 07-26-2009 15:32

Re: [CS:S] Resetscore
 
this plugin needs announcement :)

tuty 07-31-2009 08:52

Re: [CS:S] Resetscore
 
Quote:

Originally Posted by nematu (Post 882368)
this plugin needs announcement :)

what do you mean?

nematu 07-31-2009 20:54

Re: [CS:S] Resetscore
 
Quote:

Originally Posted by tuty (Post 886533)
what do you mean?

i mean that at the round start it ciuld announce that you can reset your score :roll: and on css server if you are dead it says: "[SM] You can't use this command then dead" and still resets your score :o

BeG 09-29-2009 08:40

Re: [CS:S] Resetscore
 
hi works perfectly for me... but i wish to chance the colours of the chatsau with multiple colours in one string

i have change it for my liking and recomplie it with the newest complier...

can any1 say me where is the error?

Code:

#include <sourcemod>
#include <sdktools>

#define PLUGIN_AUTHOR    "tuty"
#define PLUGIN_VERSION    "1.1"
#pragma semicolon 1

new Handle:gPluginEnabled = INVALID_HANDLE;

public Plugin:myinfo =
{
    name = "Resetscore",
    author = PLUGIN_AUTHOR,
    description = "Type !resetscore in chat to reset your score.",
    version = PLUGIN_VERSION,
    url = "www.ligs.us"
};
public OnPluginStart()
{
    RegConsoleCmd( "say", CommandSay );
    RegConsoleCmd( "say_team", CommandSay );
   
    gPluginEnabled = CreateConVar( "sm_resetscore", "1" );
    CreateConVar( "resetscore_version", PLUGIN_VERSION, "Reset Score", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY );
}
public Action:CommandSay( id, args )
{
    decl String:Said[ 128 ];
    GetCmdArgString( Said, sizeof( Said ) - 1 );
    StripQuotes( Said );
    TrimString( Said );
   
    if( StrEqual( Said, "!retry" ) || StrEqual( Said, "!resetmyscore" ) )
    {
        if( GetConVarInt( gPluginEnabled ) == 0 )
        {
            PrintToChat( id, "\x03[SM Resetscore] The plugin is disabled." );
            PrintToConsole( id, "[SM Resetscore] You can't use this command when plugin is disabled!" );
       
            return Plugin_Continue;
        }
   
        if( !IsPlayerAlive( id ) )
        {
            PrintToChat( id, "\x05[\x01ResetMyScore\x05]\x01: \x04Du kannst diesen Befehl nicht benutzen wenn du tot bist." );
            PrintToConsole( id, "[ResetMyScore]: Du kannst diesen Befehl nicht benutzen wenn du tot bist." );
       
            return Plugin_Continue;
        }

        if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
        {
            PrintToChat( id, "\x05[\x01ResetMyScore\x05]\x01: \x04Dein Score ist bereits auf 0!" );
            PrintToConsole( id, "[ResetMyScore]: Dein Score ist bereits auf 0!" );
           
            return Plugin_Continue;
        }
               
        SetClientFrags( id, 0 );
        SetClientDeaths( id, 0 );
   
        decl String:Name[ 32 ];
        GetClientName( id, Name, sizeof( Name ) - 1 );
   
        PrintToChat( id, "\x05[\x01ResetMyScore\x05]\x01: \x04Dein Score wurde erfolgreich zurückgesetzt!" );
        PrintToChatAll( "\x05[\x01ResetMyScore\x05]\x01: \x02% \x01hat seinen Score resettet.", Name );
        PrintToConsole( id, "[ResetMyScore]: Dein Score wurde erfolgreich zurückgesetzt!" );
    }
   
    return Plugin_Continue;
}   
stock SetClientFrags( index, frags )
{
    SetEntProp( index, Prop_Data, "m_iFrags", frags );
    return 1;
}
stock SetClientDeaths( index, deaths )
{
    SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
    return 1;
}

it would be nice when someone change the code so that it works with my colours ;D

thx


All times are GMT -4. The time now is 05:13.

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