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!

HL2RP Few questions on customizing things for my server.

Discussion in 'Development' started by BetaDesh, Sep 16, 2017.

  1. BetaDesh

    BetaDesh The fuck's a BetaDesh? Clockwork Customer

    Hey so I just need to know, what is the code for setting a faction's default armour when they spawn, and alsohow can I change the loading screen to a custom one when people enter my server?
     
  2. Zig

    Zig Guest

    Try looking through the MPF PlayerSpawn Hook for that stuff-
    Also the sv_loadingurl shit is in your config I think
     
  3. BetaDesh

    BetaDesh The fuck's a BetaDesh? Clockwork Customer

    I still can't find the code for the armour.
     
  4. Aberidius

    Aberidius Chief Technology Officer Staff Member Administrator Store Support

    Hello BetaDesh.

    Code:
    -- Called just after a player spawns.
    function Schema:PostPlayerSpawn(player, lightSpawn, changeClass, firstSpawn)
        if (!lightSpawn) then
            player:SetSharedVar("Antidepressants", 0);
           
            Clockwork.datastream:Start(player, "ClearEffects", true);
           
            player.cwBeingSearched = nil;
            player.cwSearching = nil;
           
            if (self:PlayerIsCombine(player) or player:GetFaction() == FACTION_ADMIN) then
                if (player:GetFaction() == FACTION_OTA) then
                    player:SetMaxHealth(150);
                    player:SetMaxArmor(150);
                    player:SetHealth(150);
                    player:SetArmor(150);
                elseif (!self:IsPlayerCombineRank(player, "RCT")) then
                    player:SetArmor(100);
                else
                    player:SetArmor(50);
                end;
            end;
           
            if (self:PlayerIsCombine(player) and player:GetAmmoCount("pistol") == 0) then
                if (!player:HasItemByID("ammo_pistol")) then
                    player:GiveItem(Clockwork.item:CreateInstance("ammo_pistol"), true);
                    player:GiveItem(Clockwork.item:CreateInstance("ammo_pistol"), true);
                end;
            end;
        end;
       
        if (self:IsPlayerCombineRank(player, "SCN")) then
            self:MakePlayerScanner(player, true, lightSpawn);
        else
            self:ResetPlayerScanner(player);
        end;
       
        if (player:GetSharedVar("IsTied") != 0) then
            self:TiePlayer(player, true);
        end;
    end;
    I believe this is what you're looking for. It can be found in sv_hooks.lua
     
    • Informative Informative x 1

Previous Readers (Total: 0)