Raised This Month: $ Target: $400
 0% 

Setting teamscore?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hayer
Junior Member
Join Date: Aug 2006
Old 07-24-2009 , 10:15   Setting teamscore?
Reply With Quote #1

Hi!

How does I increse the Counter-Terrorists score by 10?
Hayer is offline
devil001
Member
Join Date: Feb 2008
Old 07-24-2009 , 13:16   Re: Setting teamscore?
Reply With Quote #2

http://forums.alliedmods.net/showthread.php?t=27590

or try this:


Code:
/**
     * Description:        Typically adds points to everybody on the entity's team.
     * Forward params:    function(this, points, bool:cangonegative);
     * Return type:        None.
     * Execute params:    ExecuteHam(Ham_AddPointsToTeam, this, points, bool:cangonegative);
     */
    Ham_AddPointsToTeam,

__________________
Host Mist - Helping People Say Hello World
Shared | VPS | Dedicated Hosting
Backup-Spot
Secure,Fast and Reliable Offsite Backups

Last edited by devil001; 07-24-2009 at 13:20.
devil001 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 07-24-2009 , 13:24   Re: Setting teamscore?
Reply With Quote #3

Ham_AddPointsToTeam add points for all players of a team.

There is the module cshack but I don't know if it works well. AFAIK there is are no amxx plugin which alter the team score.

"ScoreInfo" event updates the team score only on the score board and not internally.
__________________

Last edited by Arkshine; 07-24-2009 at 13:27.
Arkshine is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 07-25-2009 , 02:24   Re: Setting teamscore?
Reply With Quote #4

teamscore stores in this class
CGameRules, I don't know the member variable's name. Its offset (word based) is 120(ct) & 122(t)
This class doesn't have an entity to linked with. It just declare as a global variable.
extern DLL_GLOBAL CGameRules *g_pGameRules
in win32 this offset has changed to 0x1622F4
Code:
#include <amxmodx>
#include <memhack>
 
#define PLUGIN    "Test"
#define AUTHOR    "Jim"
#define VERSION   "1.0"
 
#define OFFSET_g_pGameRules 0x1622F4
#define OFFSET_m_TScores    122
#define OFFSET_m_CTScores   120
#define TEAM_T    1
#define TEAM_CT   2
 
new g_pGameRules
new gmsgTeamScore
 
add_team_score(teamid, score)
{
    new offset
    switch(teamid)
    {
        case TEAM_T: offset = OFFSET_m_TScores
        case TEAM_CT: offset = OFFSET_m_CTScores
        default: return
    }
    new oldscore = memhack_get_short(g_pGameRules + offset, MEM_NULLBASE)
    new newscore = oldscore + score
    memhack_set_short(g_pGameRules + offset, MEM_NULLBASE, newscore)
 
    message_begin(MSG_ALL, gmsgTeamScore)
    write_string(teamid == TEAM_T ? "TERRORIST" : "CT")
    write_short(newscore)
    message_end()
}
 
public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("test", "test")
    g_pGameRules = memhack_get_pointer(OFFSET_g_pGameRules)
    gmsgTeamScore = get_user_msgid("TeamScore")
}
 
public test(id)
{
    add_team_score(TEAM_CT, 10)
    return PLUGIN_HANDLED
}
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>

Last edited by jim_yang; 07-25-2009 at 02:33.
jim_yang is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 04-07-2010 , 16:31   Re: Setting teamscore?
Reply With Quote #5

Quote:
Ham_AddPointsToTeam add points for all players of a team.
just tested it, ham adds nothing
just no effect no matter how much i do ham cmd

PHP Code:
public plugin_init()

    
register_clcmd"score1"            "score1"        , -);
}
public 
score1(id)
{
    
ExecuteHamB(Ham_AddPointsToTeamid1false);
    
log_amx("PLUS"); //

__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-07-2010 , 17:59   Re: Setting teamscore?
Reply With Quote #6

Weird. Ham_AddPoints works though.
__________________
Arkshine is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 04-10-2010 , 15:09   Re: Setting teamscore?
Reply With Quote #7

hmm.. wtf it just adds frags, nothing releted to teamscore =\
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-10-2010 , 15:13   Re: Setting teamscore?
Reply With Quote #8

Of course, I thought you had already understood that... after reading #3 above.

For team score, you have to use Orpheu. Basically g_pGamerules and the offsets 120/122.
__________________
Arkshine is offline
Reply


Thread Tools
Display Modes

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 18:27.


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