AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Freezing a player? (https://forums.alliedmods.net/showthread.php?t=29450)

Werewolf 06-06-2006 08:16

Freezing a player?
 
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 :)

NewUser 06-06-2006 11:39

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

edit: you need fun module included

v3x 06-06-2006 12:51

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; }

Kensai 06-06-2006 13:15

????
http://forums.alliedmods.net/showthread.php?p=226158

Orangutanz 06-06-2006 22:22

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.

VEN 06-07-2006 10:02

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).

Werewolf 06-08-2006 10:51

OK... How can I make them "unfrozen" then? :?
And if someone wants to help me then they can add my msn or pm.

v3x 06-08-2006 12:19

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

Edit: pmg- 6,000th post!

Shaman 12-09-2006 08:19

Re: Freezing a player?
 
Any one tested?

VEN 12-09-2006 11:07

Re: Freezing a player?
 
And why not test it yourself? Yes it work.


All times are GMT -4. The time now is 16:19.

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