Raised This Month: $ Target: $400
 0% 

Freezing a player?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 06-06-2006 , 08:16   Freezing a player?
Reply With Quote #1

How can you freeze a player?
Code:
if(+jump) return false
Can I do like that? And if that works then which are the walking commands? Like +jump and +speed.
Im working on converting CSSRPG Mod to CS, CZ and HLDM
__________________
~~~~~Hawk~~~~~
Werewolf is offline
NewUser
Member
Join Date: Mar 2006
Location: over there
Old 06-06-2006 , 11:39  
Reply With Quote #2

Code:
set_user_maxspeed(id, get_user_maxspeed(id)-319);

edit: you need fun module included
__________________
LEWL.
NewUser is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-06-2006 , 12:51  
Reply With Quote #3

I forget if this way actually works for blocking jump (requires Engine):
Code:
public client_PreThink(id) {   if(!is_user_alive(id))     return PLUGIN_CONTINUE;   if(get_user_button(id) & IN_JUMP)     entity_set_int(id , EV_INT_button , entity_get_int(id , EV_INT_button) & ~IN_JUMP);   return PLUGIN_CONTINUE; }
or something.

Fakemeta version:
Code:
#include <amxmodx> #include <fakemeta> #include <engine_stocks> public plugin_init() {   register_plugin("test" , "0.1" , "v3x");   register_forward(FM_PlayerPreThink , "fw_PreThink"); } new buttons[33]; public fw_PreThink(id) {   if(!is_user_alive(id))     return FMRES_IGNORED;   buttons[id] = pev(id , pev_button);   if(buttons[id] & IN_JUMP)   {     set_pev(id , pev_button , buttons[id] & ~IN_JUMP);     return FMRES_SUPERCEDE;   }   return FMRES_IGNORED; }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 06-06-2006 , 13:15  
Reply With Quote #4

????
http://forums.alliedmods.net/showthread.php?p=226158
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 06-06-2006 , 22:22  
Reply With Quote #5

Or FakeMeta way:
Code:
set_pev(id, pev_flags, pev(id, pev_flags) + FL_FROZEN)
Saves having to mess around with set_user_maxspeed which can vary from mod to mod.
Orangutanz is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 06-07-2006 , 10:02  
Reply With Quote #6

You should use
Code:
set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)
to not mess the flags if client already had FL_FROZEN.
It's just not a good practice to use an addition and substraction for bit operation (even though it's intigers).
VEN is offline
Werewolf
Senior Member
Join Date: Jan 2006
Location: Sweden
Old 06-08-2006 , 10:51  
Reply With Quote #7

OK... How can I make them "unfrozen" then?
And if someone wants to help me then they can add my msn or pm.
__________________
~~~~~Hawk~~~~~
Werewolf is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-08-2006 , 12:19  
Reply With Quote #8

My guess:
Code:
set_pev(id, pev_flags, pev(id, pev_flags) & ~FL_FROZEN)

Edit: pmg- 6,000th post!
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Shaman
Senior Member
Join Date: Dec 2006
Location: Istanbul, Turkey
Old 12-09-2006 , 08:19   Re: Freezing a player?
Reply With Quote #9

Any one tested?
Shaman is offline
Send a message via ICQ to Shaman Send a message via AIM to Shaman Send a message via MSN to Shaman Send a message via Yahoo to Shaman
VEN
Veteran Member
Join Date: Jan 2005
Old 12-09-2006 , 11:07   Re: Freezing a player?
Reply With Quote #10

And why not test it yourself? Yes it work.
VEN is offline
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 16:19.


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