1. This forum is ARCHIVED! Visit the new Cloud Sixteen forums, codename Eden, at https://eden.cloudsixteen.com. These forums will remain archived for a few months before being closed down, so try to encourage plugin developers to begin moving their content across to the new forums.
Dismiss Notice
Hi Guest, you need a Steam account to register and post on these forums. Login with Steam at the top of the forums to get started!
Dismiss Notice
Hi Guest, do you want to buy HL2RP or another Clockwork schema? Visit the Cloud Sixteen Store to get started!

Other Removing Wages

Discussion in 'Development' started by Zemoreageal, Dec 12, 2016.

  1. Zemoreageal

    Zemoreageal Clockwork Customer

    Hello, I just have a question to ask on how to completely remove the monetary distribution system that I cannot seem to get rid of for all factions in CWHL2RP. How would one do this?
     
  2. Just set the faction wages to 0?
     
    • Agree Agree x 1
  3. Svensis

    Svensis Guest

    idk any other way than just modifiyng the classes in
    gamemodes/cwhl2rp/schema/factions/classes

    to remove vV getting some stuff look around sh_hooks, cl_hooks, sv_hooks
     
    • Agree Agree x 1
  4. Zemoreageal

    Zemoreageal Clockwork Customer

    I've removed the one for citizen, yet it still keeps paying the Citizen faction.
     
  5. RJ

    RJ no pay Legend Clockwork Customer

    If you wanted to remove a player's default wage (e.g. an MPF recruit making 10 tokens), then you'd find the class by ID (wages are usually stored under classes) and change its wages value to 0 like so:

    Code:
    local mpfRecruit = Clockwork.class:FindByID("Metropolice Recruit");
    
    mpfRecruit.wages = 0;
    This would work in a plugin and would go in the sh_plugin.lua file. As for wages received from BMD flags, here's how you'd do that (sv_hooks.lua in a plugin):

    Code:
    -- Called at an interval while a player is connected.
    function PLUGIN:PlayerThink(player, curTime, infoTable)
        if (Clockwork.player:HasAnyFlags(player, "vV")) then
            if (infoTable.wages == 0) then
                infoTable.wages = 0;
            end;
        end;
    end;
    That code is untested but basically follows the same methods of a player receiving BMD wages in the first place, it just sets their wages to 0 instead of 20. If it doesn't work then it probably has to do with the order of the plugin's function being called.
     

Previous Readers (Total: 0)