Solved How to freeze players

Discussion in 'Rust Development' started by PaiN, Apr 20, 2015.

  1. I think there was a Rust Legacy plugin named Confuseray? something like that from that what i remember it was freezing the player .. So is it possible to freeze players in Experimental ? i need this bcs i'm making a plugin so after the guys types the command it gives a tag and freezes untill he write an another one :p
     
  2. Wulf

    Wulf Community Admin

    You'd need to either reset their position on movement or unbind their keys (if possible on Exp).
     
  3. Use the OnClientMove hook to reset there position if they are frozen.
     
  4. Okay that's cool but how can i reset ? thats a good question :p i'm newbie

    and how can i add space between player.displayname and blamessage ? bcs
    rust.BroadcastChat(player.displayName .. self.Config.Messages.BlaMessage)
     
  5. Return false to stop movement, if that doesn't work just teleport them back to the position they were froze at.
     
  6. What about this ?
     
  7. Wulf

    Wulf Community Admin

    Code:
    rust.BroadcastChat(player.displayName .. " " .. self.Config.Messages.BlaMessage)
     
  8. Code:
    function PLUGIN:OnClientMove()
    if Bla[userID] = true
    return false
    end
    end
    
    I did something wrong ? cause its not working

    I mean there are no errors the cmd works great but something with this function is not good :p
     
  9. That's an internal hook and shouldn't really be used by a plugin! :p
     
  10. So what am i supposed to do now xD?

    i just want to freeze them at the posistion that they typed the command /bla for example
     
  11. I would more so say that its up to the plugin developer if they want to trash performance of their server using a lua plugin implementing said hook.
    [DOUBLEPOST=1429549287][/DOUBLEPOST]
    Figure out your own way of doing it. We are not here to write your plugin for you or the logic behind it.
     
  12. So there is a way ? If yes no problem :)
     
  13. It's also a legacy hook and not experimental ;)
     
  14. Worked on it a bit :) its looking awesome thanks guys but one error and i'm done with this plugin
    lines 37,38,39,40,41
    Code:
    function PLUGIN:OnPlayerSleepEnded(BasePlayer, player)
        local userID = rust.UserIDFromPlayer(player)
        if Bla[userID] then
        rust.BroadcastChat(player.displayName.." ".. self.Config.Messages.IsNotBlaMessage)
        end
    
    The plugin works perfectly on loading after i type /bla it sends a message to chat and make the player sleep so
    OnPlayerSleepEnded
    ERROR
     
  15. the BasePlayer player in the information is the type and variable name so you just call it with player (or whatever you want to use) in lua:
    Code:
    function PLUGIN:OnPlayerSleepEnded(player)
     
  16. Fixed everything alone .. xD sry for this post
     
    Last edited by a moderator: Apr 20, 2015