Raised This Month: $51 Target: $400
 12% 

[L4D/L4D2] No Score


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
PatPeter
Member
Join Date: Apr 2009
Location: Chicago
Old 10-09-2010 , 20:48   [L4D/L4D2] No Score
Reply With Quote #1

Hello all,

I started coding this myself, but then I realized I'd just be placing one more thing on my plate to which I cannot afford the time, so I come to the community.

For the longest time my organization played 4v4 versus with one team of our members and another team of pubbers. This worked for a while but then we started playing 8-man group matches and for whatever reason we have become too competitive. This competition is causing a lot of in-fighting and I have an idea on how to turn it down.

I would appreciate anyone's code or code segments that would allow me to, either at the beginning of a round or the end of a round in Left 4 Dead 2 and Left 4 Dead (the latter applicable only if it can be easily ported), wipe the scores down to zero for the entire campaign.

Whichever the coder would more likely prefer, I do not care, though the latter sounds much more stable. I know that both:

http://forums.alliedmods.net/showthread.php?p=781689
and
http://forums.alliedmods.net/showthread.php?p=1029519

have this functionality, but I want as lightweight a plugin as possible.

Thank you for your time in reading this message,
PatPeter
__________________
SourceMod = Linux
EventScripts = Windows
Mani = Mac OS

Last edited by PatPeter; 04-29-2012 at 22:21. Reason: Update conditions.
PatPeter is offline
PatPeter
Member
Join Date: Apr 2009
Location: Chicago
Old 11-27-2010 , 19:21   Re: [L4D/L4D2] No Score
Reply With Quote #2

Code:
#include <sourcemod>
 
public Plugin:myinfo =
{
    name = "l4dnoscores",
    author = "PatPeter",
    description = "Removes the score .",
    version = "0.0.0.1",
    url = "http://www.sourcemod.net/"
}

public OnPluginStart()
{
    PrepareAllSDKCalls();
    
    // SetCampaignScores
    StartPrepSDKCall(SDKCall_GameRules);
    if(PrepSDKCall_SetFromConf(gConf, SDKConf_Signature, "SetCampaignScores")) {
        PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain);
        PrepSDKCall_AddParameter(SDKType_PlainOldData, SDKPass_Plain);
        fSetCampaignScores = EndPrepSDKCall();
        if(fSetCampaignScores == INVALID_HANDLE) {
            DebugPrintToAll("[TEST] Function 'SetCampaignScores' found, but something went wrong.");
        } else {
            DebugPrintToAll("[TEST] Function 'SetCampaignScores' initialized.");
        }
    } else {
        DebugPrintToAll("[TEST] Function 'SetCampaignScores' not found.");
    }
}

ClearScores() {
    SDKCall(fSetCampaignScores, 0, 0);
    SDKCall(fSetCampaignScores, 1, 0);
}
This is what I've had on my desktop for months now.
__________________
SourceMod = Linux
EventScripts = Windows
Mani = Mac OS
PatPeter is offline
PatPeter
Member
Join Date: Apr 2009
Location: Chicago
Old 04-29-2012 , 22:22   Re: [L4D/L4D2] No Score
Reply With Quote #3

Does anyone have an idea on how to finish this?
__________________
SourceMod = Linux
EventScripts = Windows
Mani = Mac OS
PatPeter is offline
spumer
Senior Member
Join Date: Aug 2011
Old 05-04-2012 , 05:47   Re: [L4D/L4D2] No Score
Reply With Quote #4

Use OnMapStart, OnMapEnd and hook events "round_start", "round_end" with Pre or Post flags.
Clear score where you need it. It's so simply.
spumer is offline
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 20:30.


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