AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:S] Cashbonus Edit - dev function tool (https://forums.alliedmods.net/showthread.php?t=345034)

Bacardi 12-28-2023 22:19

[CS:S] Cashbonus Edit - dev function tool
 
1 Attachment(s)
[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 ? :bee:
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.


All times are GMT -4. The time now is 19:20.

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