Raised This Month: $32 Target: $400
 8% 

No reset score and team score


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
4ever16
Veteran Member
Join Date: Apr 2015
Old 08-12-2015 , 17:13   No reset score and team score
Reply With Quote #1

Doesnt reset your score when sv_rounrestart.
https://forums.alliedmods.net/showth...ighlight=score

But i also need dont reset team score when sv_roundrestart.

Last edited by 4ever16; 08-12-2015 at 17:15.
4ever16 is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-14-2017 , 19:41   Re: No reset score and team score
Reply With Quote #2

I need this very much!
Maybe a cvar to reset score after warmup.

edit: I think my request is a little different actually.
I want the team score to stay the same, but I want to switch them when its time for team change in 5 v 5.

Last edited by suhdude; 11-14-2017 at 20:03.
suhdude is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-14-2017 , 20:11   Re: No reset score and team score
Reply With Quote #3

PHP Code:
#include <amxmodx>
#include <fakemeta> 
#include <hamsandwich>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

enum dData
{
    
iFrags,
    
iDeaths
}

new 
g_iUserData[33][dData], bool:g_bCanSet

const m_iDeaths =        444

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""ham_PlayerSpawn_Post"1)
    
    
register_event("TextMsg","EventRestart","a","2&#Game_C","2&#Game_w")
}

public 
ham_PlayerSpawn_Post(id)
{
    if(
g_bCanSet && is_user_alive(id))
    {
        
updateScore(id)
    }
}

public 
EventRestart()
{
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)
    
    if(!
iNum)
        return
    
    
g_bCanSet true
    
    
for(new iid;iNum;i++)
    {
        
id iPlayers[i]
        
        if(
get_user_team(id) <= 2)
        {
            
g_iUserData[id][iFrags] = get_user_frags(id)
            
g_iUserData[id][iDeaths] = get_user_deaths(id)
        }
    }
}  

updateScore(id)
{
    
set_pdata_int(idm_iDeathsg_iUserData[id][iDeaths]) 
    
ExecuteHam(Ham_AddPointsidg_iUserData[id][iFrags], true)

I didn't test.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 11-15-2017 at 12:31.
EFFx is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-14-2017 , 20:20   Re: No reset score and team score
Reply With Quote #4

Quote:
Originally Posted by EFFx View Post
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define IsAvaliable(%0)        (CS_TEAM_T <= cs_get_user_team(%0) <= CS_TEAM_T)

enum dData
{
    
iFrags,
    
iDeaths
}

new 
g_iUserData[33][dData], bool:g_bCanSet

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("HLTV","EventNewRnd""a""1=0""2=0")
    
register_event("TextMsg","EventRestart","a","2&#Game_C","2&#Game_w")
}

public 
EventNewRnd()
{
    if(!
g_bCanSet)
        return
        
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)

    for(new 
iid;iNum;i++)
    {
        
id iPlayers[i]
        
        if(
IsAvaliable(id))
        {
            
set_user_frags(idg_iUserData[id][iFrags])
            
cs_set_user_deaths(idg_iUserData[id][iDeaths])
        }
    }
}

public 
EventRestart()
{
    new 
iPlayers[32], iNum
    get_players
(iPlayersiNum)
    
    if(!
iNum)
        return
        
    
g_bCanSet true
    
    
for(new iid;iNum;i++)
    {
        
id iPlayers[i]
        
        if(
IsAvaliable(id))
        {
            
g_iUserData[id][iFrags] = get_user_frags(id)
            
g_iUserData[id][iDeaths] = cs_get_user_deaths(id)
        }
    }

I didn't test.
Thank you.

All I noticed was the player score was reset every round.
So I don't think its working.

Last edited by suhdude; 11-14-2017 at 20:20.
suhdude is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-15-2017 , 02:21   Re: No reset score and team score
Reply With Quote #5

Maybe I should update the scoreboard, I'm gonna check it.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-15-2017 , 12:29   Re: No reset score and team score
Reply With Quote #6

Code updated.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-15-2017 , 19:33   Re: No reset score and team score
Reply With Quote #7

Quote:
Originally Posted by EFFx View Post
Code updated.
Hmm, I see no change.
The team score is still the same after sv_restart 1 and sv_restartround 1
suhdude is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-16-2017 , 10:07   Re: No reset score and team score
Reply With Quote #8

I tested and it works. Make sure the plugin is enabled.

Btw, you're not the topics owner.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 11-16-2017 at 10:08.
EFFx is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-16-2017 , 10:26   Re: No reset score and team score
Reply With Quote #9

Quote:
Originally Posted by EFFx View Post
I tested and it works. Make sure the plugin is enabled.

Btw, you're not the topics owner.
It doesent do what the OP asked for.
"But i also need dont reset team score when sv_roundrestart."

Last edited by suhdude; 11-16-2017 at 10:26.
suhdude is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 11-17-2017 , 11:32   Re: No reset score and team score
Reply With Quote #10

Should be working if i see this code.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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