AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block Player Movement (https://forums.alliedmods.net/showthread.php?t=83278)

joaquimandrade 01-07-2009 04:27

Block Player Movement
 
I would like to ask you if you can show me a way to block a player's movement like the way it is in the freeze time plus no jump. The player should not be able to move, just to rotate over its body.

zwfgdlc 01-07-2009 04:57

Re: Block Player Movement
 
PHP Code:

#include <fakemeta>

stock fm_set_user_frozen(id)
{
    
set_pev(id,pev_flags,pev(id,pev_flags)&FL_FROZEN?pev(id,pev_flags)&~FL_FROZEN:pev(id,pev_flags)|FL_FROZEN);



Exolent[jNr] 01-07-2009 12:10

Re: Block Player Movement
 
Code:
#include <fakemeta> // if frozen is 1, freeze client // if frozen is 0, unfreeze client stock fm_set_user_frozen(client, frozen) {     if( !is_user_alive(client) ) return 0;         new flags = pev(client, pev_flags);     if( frozen && !(flags & FL_FROZEN) )     {         set_pev(client, pev_flags, (flags | FL_FROZEN));     }     else if( !frozen && (flags & FL_FROZEN) )     {         set_pev(client, pev_flags, (flags & ~FL_FROZEN));     }         return 1; }

Or, you can set player's maxspeed to -1.0, gravity to 0.000001, and velocity to {0.0, 0.0, 0.0}

joaquimandrade 01-07-2009 12:49

Re: Block Player Movement
 
Thank you both very much. One more question: where you can learn about fakemeta to do thing like these?

SnoW 01-07-2009 12:58

Re: Block Player Movement
 
Possible way would be read fakemeta.inc? Also fakemeta.const and fakemeta_util.inc would be nice to check... They exist in amxmodx/Scripting/Include if you have installed amxmodx (Think you probably have)

joaquimandrade 01-07-2009 12:58

Re: Block Player Movement
 
Your code adds a thing that i wouldn't want to happen. A player with an AWP cannot do +attack2. He can't use the scope.

SnoW 01-07-2009 13:01

Re: Block Player Movement
 
If you want that player is only move freezed:
Quote:

Originally Posted by Exolent[jNr] (Post 739872)
Or, you can set player's maxspeed to -1.0, gravity to 0.000001, and velocity to {0.0, 0.0, 0.0}


One 01-07-2009 13:05

Re: Block Player Movement
 
Hey,

client_cmd <<< unbindall

:-D was just jking :-D

Bestidea : zwfgdlc :-D

joaquimandrade 01-07-2009 13:13

Re: Block Player Movement
 
Quote:

Originally Posted by SnoW (Post 739897)
If you want that player is only move freezed:

"Or, you can set player's maxspeed to -1.0, gravity to 0.000001, and velocity to {0.0, 0.0, 0.0}"

None of these three are blocking the players movement. The only that happens to change anything is gravity but it is just sticking the player to the ceil after jumping.

SnoW 01-07-2009 13:29

Re: Block Player Movement
 
You are wrong. Setting user speed that low makes him not able to walk/run/swim, gravity -> he can't jump and velocity stops him if he were in speed already. That blocks the players movement todally said you or what.
Edit: Btw, Did you mean that you can't zoom when frozen?


All times are GMT -4. The time now is 09:13.

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