lordkabab Posted February 16, 2009 Share Posted February 16, 2009 How can I do this? I've seen it on an amunation script where the player enters a marker and then gets locked into it (so they can't move) untill thy finish buying weapons, how can I make it so that it un locks them when they type a command (it's for a toll booth so the command will be a payment one)? Link to comment
jkub Posted February 16, 2009 Share Posted February 16, 2009 Hy Kabab Its philly.. anyway from what I understand You would like to lock the player in the marker until a certain command is entered. 1 Way to do this would be to disable the players controls like toggleAllControls ( thePlayer, false ) << That would completly freeze him or their is like toggleControl ( thePlayer, "forwards", false ) toggleControl ( thePlayer, "backwards", false ) toggleControl ( thePlayer, "left", false ) toggleControl ( thePlayer, "right", false ) ^^^disable the specific movement controls Link to comment
lordkabab Posted February 16, 2009 Author Share Posted February 16, 2009 Ah thanks Philly, That's awesome. Although, now, with that, the controls would disable, but they would still be rolling though, so is there a way to fully stop them (sort of like the admin freeze)? Also, is there a way I can make the command only work when in the marker? Link to comment
Ace_Gambit Posted February 16, 2009 Share Posted February 16, 2009 Create a small object inside the marker on ground level and attach/detach the player on top of that object. This is probably the best way of doing it. Because like you said if someone is running, disabling controls does not instantly make the player stop moving. As a result the player may freeze outside the marker. Link to comment
lordkabab Posted February 16, 2009 Author Share Posted February 16, 2009 Will that work when they're in a vehicle? Link to comment
Gamesnert Posted February 16, 2009 Share Posted February 16, 2009 If he's in a vehicle, attach the vehicle instead of the player, and disable "enter_exit" control for the duration of the lock. OR Remove the player from the vehicle (removePlayerFromVehicle for DP2.3, removePedFromVehicle for 1.0) and then attach the player. Both ways will probably lock him up pretty good. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now