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

[CS:S] Cashbonus Edit - dev function tool


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Plugin ID:
8617
Plugin Version:
29.12.2023
Plugin Category:
Technical/Development
Plugin Game:
Counter-Strike: Source
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Edit some game cashbonus rewards
    Old 12-28-2023 , 22:19   [CS:S] Cashbonus Edit - dev function tool
    Reply With Quote #1

    [CS:S] Cashbonus Edit
    - Edit some game cashbonus rewards. Windows/Linux

    Counter-Strike: Source game have these bonus reward money settings, what you can change. And that is it.
    Code:
    	"mp_startmoney" = "800" min. 800.000000 max. 16000.000000
    	 - amount of money each player gets when they reset
    With this function tool code, you can go deeper, edit some more in game bonus rewards.
    Here is preview from example plugin.
    PHP Code:
    // PLAYER KILLED
    "CASHBONUSEDIT_TEAMKILL"                  "-3300"
    "CASHBONUSEDIT_VIPKILL"                   "2500"
    "CASHBONUSEDIT_ENEMYKILL"                 "300"

    //hostage ontakedamage alive
    "CASHBONUSEDIT_HOSTAGEHURT"               "-20"    // multiplier dmg x N

    //event hostage_killed
    "CASHBONUSEDIT_HOSTAGEKILLED"             "-20"    // multiplier dmg x N

    //HostageRescueZoneTouch
    "CASHBONUSEDIT_RESCUERCASHBONUS"          "1000"

    // BOMB ROUND END CHECK
    "CASHBONUSEDIT_TARGETBOMBED"              "3500"
    "CASHBONUSEDIT_BOMBDEFUSED"               "3250"
    "CASHBONUSEDIT_BOMBDEFUSEDPLANTINGBONUS"  "800"

    // TEAM EXTERMINATION
    "CASHBONUSEDIT_CTWINBOMBMAP"              "3250"
    "CASHBONUSEDIT_CTWIN"                     "3000"
    "CASHBONUSEDIT_TWINBOMBMAP"               "3250"
    "CASHBONUSEDIT_TWIN"                      "3000"

    // VIP ROUNDEND CHECK
    "CASHBONUSEDIT_VIPESCAPED"                "3500"
    "CASHBONUSEDIT_VIPKILLED"                 "3250"

    // CHECK ROUNDTIME EXPIRED
    "CASHBONUSEDIT_TARGETSAVED"               "3250"
    "CASHBONUSEDIT_HOSTAGESNOTRESCUED"        "3250"
    "CASHBONUSEDIT_VIPNOTESCAPED"             "3250"

    //HostageRescueRoundEndCheck
    "CASHBONUSEDIT_HOSTAGERESCUEDALL"         "2500"

    //Give CT use bonus
    "CASHBONUSEDIT_GIVECTUSEBONUS"            "100"
    "CASHBONUSEDIT_GIVERESCUERUSEBONUS"       "150"

    //Restart round
    "CASHBONUSEDIT_HOSTAGEBONUS"              "150"
    "CASHBONUSEDIT_MAXHOSTAGEBONUS"           "1999"    
    // OS Windows it is 2000...
    "CASHBONUSEDIT_HOSTAGESRESCUEDBONUS"      "750"
    "CASHBONUSEDIT_DEFAULTLOSERBONUS_TWIN"    "1500"
    "CASHBONUSEDIT_DEFAULTLOSERBONUS_CTWIN"   "1500"
    "CASHBONUSEDIT_MAXLOSERBONUS_T"           "2999"    
    // OS Windows it is 3000...
    "CASHBONUSEDIT_MAXLOSERBONUS_CT"          "2999"    // OS Windows it is 3000...
    "CASHBONUSEDIT_LOSERBONUS"                "500"
    "CASHBONUSEDIT_FIRSTLOSERBONUS"           "1400" 
    So, to clarify more, what if we want earn money of teamkilling or hostage hurt/killing ? Or cancel them ?
    There are also few bonus money upper limits what can be raise higher.

    This function tool look those "hardcoded" bonus money values from game memory and then change it with given value. (Poking code from memory!).

    For developers:
    Install these files, include <css_cashbonusedit> in your own plugin source code.
    Code:
    ----sourcemod
        │
        ├───gamedata
        │       css_cashbonusedit.games.txt
        │
        │
        └───scripting
            │
            └───include
                    css_cashbonusedit.inc
    PHP Code:
    #include <css_cashbonusedit>

    public void OnPluginStart()
    {
        
    int value;
        
        
    // Get cashbonus value
        
    cashbonusedit(CASHBONUSEDIT_BOMBDEFUSEDvalue);
        
    PrintToServer("CASHBONUSEDIT_BOMBDEFUSED %d"value);

        
    // Set cashbonus value
        
    value 14;
        
    cashbonusedit(CASHBONUSEDIT_BOMBDEFUSEDvaluetrue);

    For others:
    Install these files and you can try example plugin (css_cashbonusedit.smx)
    Code:
    └───sourcemod
        ├───configs
        │   └───cashbonusedit
        │           de_dust2.txt
        │           reset.txt
        │
        ├───gamedata
        │       css_cashbonusedit.games.txt
        │
        ├───plugins
                css_cashbonusedit.smx
    - With reset.txt configure file, you can reset default values back on map start.
    - You can create map configure file, ex. de_dust2.txt and use different values on that map.





    If you experience server crashes, please remove plugin(s) what use this tool and try again.
    Mention if this cause problems.
    Attached Files
    File Type: zip css_cashbonusedit.zip (14.3 KB, 14 views)

    Last edited by Bacardi; 01-23-2024 at 09:00. Reason: placed CRC check top in gamedata file (20 views)
    Bacardi 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 02:54.


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