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!

Faction walk/run speed assistance [Fixed]

Discussion in 'Programming' started by Tomo742, Jun 11, 2014.

  1. Tomo742

    Tomo742 Guest

    Re: Faction walk/run speed assistance

    So what you're saying is, I'd have to overwrite the clockworks plugin? Or perhaps even edit it for my server but I doubt that is something I should really do.

    Oh mighty [member=5522]Atebite[/member] and [member=5482]duck[/member], please assist me with this.

    Edit -

    Okay so, I've checked over the plugin and even removed it completely and got nothing fixed from that. So, I've come to a conclusion that there are too many things being ran in clockwork that are automatically setting the walk/run speed every playerthink or something.

    I think I'm going to have to talk with [member=1]kurozael[/member] or something about this, so I'm hoping he might help. ;_;
     
  2. NightAngel

    NightAngel Fuck off Lev

    Re: Faction walk/run speed assistance

    This is what I have for my Zombie plugin.

    Code:
    function PLUGIN:PlayerThink(player, curTime, infoTable)
    	if (PLUGIN:PlayerIsZombie(player)) then
    		if (!infoTable.isJogging) then
    			infoTable.walkSpeed = 45
    		end;
    	end;
    end;
    And this is what I have for slowing a person if they go underwater.

    Code:
    --Called when a player thinks.
    function PLUGIN:PlayerThink(player, curTime, infoTable)
    	if (player:WaterLevel() == 3 or player:WaterLevel() == 2) then
    		if (player:GetMoveType()==MOVETYPE_WALK) then
    			infoTable.walkSpeed = 60
    			infoTable.runSpeed = 70
    			if (infoTable.isJogging == true) then
    				infoTable.isJogging = false
    			end;
    		end;
    	end;
    end;
    These both work for me in each plugin's sv_plugin.lua. Hope that helps! :)
     
    • Good Coder Good Coder x 1
  3. Tomo742

    Tomo742 Guest

    Re: Faction walk/run speed assistance

    Ah well, I've actually already fixed this problem on my own. Except I run it when the player spawns and not every playerthink tick, so it's actually much more optimised in a way.

    None the less, thank you for the contribution. (Shoulda probably set this to fixed but I forgot to)
     
  4. Mind sharing the solution?
     
  5. Tomo742

    Tomo742 Guest

    It used exactly what he's using now, except modified to include attributes and whatnot.

    infoTable.walkSpeed = 60
    infoTable.runSpeed = 70

    Aparently using player.runSpeed = 70 wouldn't work because of how clockwork uses speeds.

    Code:
    if(player:GetFaction() == FACTION_SURVIVOR) then
    	infoTable.inventoryWeight = infoTable.inventoryWeight + strength;
    	infoTable.jumpPower = infoTable.jumpPower + acrobatics;
    	infoTable.runSpeed = infoTable.runSpeed + agility;
    	infoTable.walkSpeed = infoTable.walkSpeed;
    end;
    or in the case of something that actually changes the speeds.

    Code:
    if(player:GetFaction() == FACTION_VELOCIRAPTOR) then
    	infoTable.inventoryWeight = infoTable.inventoryWeight + strength;
    	infoTable.jumpPower = infoTable.jumpPower + acrobatics  + 70;
    	infoTable.runSpeed = infoTable.runSpeed + agility + 200;
    	infoTable.walkSpeed = infoTable.walkSpeed + 30;
    end:
     
  6. Cheers, that'll help in the future.
     
  7. Tomo742

    Tomo742 Guest

    I was thinking of making a config file for HL2RP that allows people to change the speeds of each faction, however we will see because I kind of don't do HL2RP anymore.
     

Previous Readers (Total: 0)