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 Help - /DoorKick Command

Discussion in 'Plugins' started by Frost, Nov 20, 2018.

  1. Howdy, I recently found online some code for a /DoorKick command. It works, but the problem is, is that everyone can use it, no matter what faction they are. This came to my attention when minges came on and kicked open combine locked doors, which broke the locks. I said to myself, "okay, I can fix this easy", and I set the faction checker to, "if (faction == FACTION_MPF) then", but then no one could use the command, not even MPF. Can anyone provide some advice/help?

    Code: https://pastebin.com/nf1KCrMU

    Thanks!
     
  2. Aspect

    Aspect =) Legend Clockwork Customer

    Paste the whole command code here.
     
    • Friendly Friendly x 1
  3. Aspect

    Aspect =) Legend Clockwork Customer

    Change
    Code:
    faction
    to
    Code:
    player:GetFaction()
     
    • Friendly Friendly x 1
  4. Alrighty, I'll try that out and let you know what happens.
     
    • Informative Informative x 1
  5. Had no luck there, non-MPF can still /DoorKick.
     
  6. Aspect

    Aspect =) Legend Clockwork Customer

    Hmm, dunno, also kinda tired to look more into it rn. Sorry. Maybe someone else can help you.
     
    • Like Like x 1
  7. vexus

    vexus ej rockwell's worst nightmare Staff Member Manager Legend Clockwork Customer

    Try using the PlayerIsCombine function instead. That way we can rule out naming issues with your factions.
     
    • Agree Agree x 1
    • Winner Winner x 1
  8. _HappyGoLucky

    _HappyGoLucky Clockwork Customer

    Replace
    Code:
    if (faction == FACTION_OTA or faction == FACTION_MPF or faction == FACTION_RESISTANCE) then
    with
    Code:
    if (Schema:PlayerIsCombine(player) or player:GetFaction() == FACTION_RESISTANCE) then
    just giving a bit more detail on what @vexus said
     
    • Good Coder Good Coder x 1
  9. Aye, I did what Vexus said and that worked. Thank you!
     
    • Like Like x 2

Previous Readers (Total: 0)