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!

Need help with a line of code

Discussion in 'Development' started by MrNeon, Nov 21, 2014.

  1. I need help with making an if statement that will check if the player is in ragdoll status.
    And another question, is there a wiki for all of the clockwork commands (Code)?

    Thank you.
     
  2. Lev

    Lev certified honorable guy

  3. Thank you once again.
     
  4. Arbiter329

    Arbiter329 Owner of Arc-Factory Roleplay

  5. Thank you sir.
     
  6. Sorry for being annoying but i need some help with fixing this code:

    Code:
    function COMMAND:OnRun(player, arguments)
            local target = Clockwork.player:FindByID(arguments[1]);
     
            if (target) then
                    local name = target:Name();
     
                    if (!target:IsRagdolled()()) then
                            Clockwork.target:SetRagdollState(ply, RAGDOLL_FALLENOVER, nil)();
                            target:Notify(player:Name().." has forced you to fall.");
                            player:Notify(name.." has been forced to fall by you.");
                            Clockwork.kernel:PrintLog(LOGTYPE_MINOR, player:Name().." has forced "..name.." to fall over.");
                    else
                            player:Notify(name.." has already fallen!")
                    end;
            else
                    player:Notify(arguments[1].." is not a valid character!");
            end;
    end;
    
    COMMAND:Register()
    
    So basically this should make the target fallover.
     
  7. Sixx

    Sixx presidential #1 Legend

    I don't know about code but if you need help with a line I got a guy that can help you out 8)

    But no, there is no wiki page for the Clockwork codes, you just have to mess around with them until you figure it out I guess.
     
  8. duck

    duck Phant0m Legend

    You have ()'s in unnecessary places and that is causing it to error.

    Code:
    if (!target:IsRagdolled()()) then
    Clockwork.target:SetRagdollState(ply, RAGDOLL_FALLENOVER, nil)();
    You're also using the invalid variable of ply. It's player, not ply.
     
  9. Okay, thank you for the help.
     
  10. Sixx

    Sixx presidential #1 Legend

    I was wondering what those strings were trying to register, but I didn't want to say something in case I sounded like an idiot.
    I feel smart now.

    Woo.
     

Previous Readers (Total: 0)