Raised This Month: $100 Target: $400
 25% 

amx freeze


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   ConnorMcLeod (74)
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-05-2010 , 18:24   amx freeze
Reply With Quote #1

Code:
    amx_freeze 
    by Drekes
    
    Description:
        Makes it able for admins to freeze a player, this will make him unable to move or jump.
        
    Cvars:
        amx_freeze_knife_only 0/1    Makes a frozen player hold only his knife
        
    Command:
        amx_freeze <@all/@T/@CT/player> <0/1> <seconds>
        
        seconds is optional.
        
    Changelog: 
        v1.0: - Release
        
        v1.1: - Merged several functions.                    darkgod's suggestion
              - Remade the activity code.                    darkgod's suggestion
              - Changed the numtime code.                    darkgod's suggestion
              - Added a timer.                                Elite Taco's suggestion
              - Added cvar for game-monitor
              
        v1.2: - Changed way of freezing                       Many peoples suggestion
              - knife only (cvar)
        
        v1.3: - Added @ct/@t/@all support                    ConnorMcleod's suggestion.
              - Filtered curweapon                             ConnorMcleod's suggestion.
              - changed timer code.
             
        v1.4: - Converted to fakemeta.
              - Made cstrike version.
        
        v1.5: - Blocked players view when frozen.            ConnorMcleod's suggestion.
              - Used bits to check and set frozen players.    ConnorMcleod's suggestion.
             
        v1.6: - Remove reduntant code.                        ConnorMcleod's suggestion.
              - Removed cstrike version since 
                get_user_team isn't used anymore.
              - unregistered PlayerPreThink when it's not
                needed.                                        ConnorMcLeod's suggestion.
            
        v1.7: - optimized code                                ConnorMcLeod's suggestion.
        
        v1.8: - Changed syntax of command                     Seta00's suggestion.
              
    Credits:
        - RedRobster: Helping me find an annoying mistake that kept crashing my server.
        - Bugsy: For the bitfield tutorial and the macro's.
        - ConnorMcleod / ArkShine / Seta00: Suggestions to improve the plugin.
        - All the other people that suggested and helped improving the plugin
Attached Files
File Type: sma Get Plugin or Get Source (amx_freeze.sma - 4508 views - 6.0 KB)
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.

Last edited by drekes; 11-03-2010 at 07:02.
drekes is offline
Send a message via MSN to drekes
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-05-2010 , 19:19   Re: amx freeze
Reply With Quote #2

One question, why you are using set_user_gravity( )?
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-05-2010 , 19:25   Re: amx freeze
Reply With Quote #3

There are better ways of freezing them using fakemeta.

Quote:
Originally Posted by Alucard^ View Post
One question, why you are using set_user_gravity( )?
Probably so they can't jump I'm assuming.
__________________
fysiks is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-05-2010 , 19:26   Re: amx freeze
Reply With Quote #4

to prevent him from jumping around. If an admin freezes a player for some reason, and he wants to kill him, it sucks if he keeps jumping all the time.

Edit:
@ fysiks: Could you guide me in the right direction?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-05-2010 , 19:30   Re: amx freeze
Reply With Quote #5

PHP Code:
set_pev(idpev_velocity, { 0.0 0.0 0.0 } )
set_pev(idpev_flagspev(ipev_flags) | FL_FROZEN
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-05-2010 , 19:31   Re: amx freeze
Reply With Quote #6

Nice, i'll check that out.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Old 08-05-2010, 19:34
wrecked_
This message has been deleted by wrecked_. Reason: That.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-05-2010 , 20:04   Re: amx freeze
Reply With Quote #7

Quote:
Originally Posted by Alucard^ View Post
PHP Code:
set_pev(idpev_velocity, { 0.0 0.0 0.0 } )
set_pev(idpev_flagspev(ipev_flags) | FL_FROZEN
Why would you set velocity if they are frozen? I guess so they stop mid-air?

@drekes, I originally found it in Gungame for when the game was won.
__________________
fysiks is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-05-2010 , 20:23   Re: amx freeze
Reply With Quote #8

fysiks is right, set velocity is useless, frozen flag will stop the player wherever he is.
If you also want to block player from using his mouse, reset his v_angle every pre or post think (don't remember which one but both could work).
__________________
- tired and retired -
ConnorMcLeod is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 08-06-2010 , 02:59   Re: amx freeze
Reply With Quote #9

Quote:
Originally Posted by ConnorMcLeod View Post
fysiks is right, set velocity is useless, frozen flag will stop the player wherever he is.
If you also want to block player from using his mouse, reset his v_angle every pre or post think (don't remember which one but both could work).
Yep, i know that, i tested some time ago... BUT, if i am not wrong, that fix some bugs, for example with push/teleports, but i am really not sure about this, correct me if i am wrong... i used the velocity things becouse i read some of that thing some time ago.

Sry for my english.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 08-06-2010 , 05:37   Re: amx freeze
Reply With Quote #10

Updated

@Connor:
I tried to block the v_angles with this:
Code:
entity_set_vector(id, EV_VEC_v_angles, {0.0, 0.0, 0.0})
But i got tag mismatch.
And when i used an empty float, nothing happened. I added a client_print in PreThink and PostThink to check if i did it right, and it is being called.
Could you show an example how i should do it?

@ all:
Thanks for the suggestions.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:20.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode