AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   No jumping & attacking while freezed (https://forums.alliedmods.net/showthread.php?t=300832)

PurposeLessx 08-31-2017 13:38

No jumping & attacking while freezed
 
Hello friends,
I need a plugin that block everything while freezed.
Not jump, not duck, not attack. Not do anything.

I tried to block 'em with " RegisterHookChain(RG_CBasePlayer_Jump, "Player_Jump"); "
But I couldn't because of I don't know very well about reapi. I tried with hamsandwich.
Again I couldn't.
Thanks for helping

kristi 08-31-2017 14:20

Re: No jumping & attacking while freezed
 
set_pev(id, pev_flags, pev(id, pev_flags) | FL_FROZEN)

set_entvar(id, var_flags, get_entvar(id, var_flags) | FL_FROZEN)

PurposeLessx 08-31-2017 14:32

Re: No jumping & attacking while freezed
 
I tried it.
PHP Code:

set_entvar(players[i], var_flagsget_entvar(players[i], var_flags) | FL_FROZEN); 

But they can still jump and attack everywhere and everyone.
I am trying it with bots. It can not block them because of they are bot, it can be?

EFFx 08-31-2017 16:53

Re: No jumping & attacking while freezed
 
If you're trying with podbots, it should work.

PurposeLessx 09-01-2017 02:06

Re: No jumping & attacking while freezed
 
They are not podbots. They are more advanced than podbots.

CrazY. 09-01-2017 08:12

Re: No jumping & attacking while freezed
 
set_entvar? Why just not use set_pev/entity_set_int?

HamletEagle 09-01-2017 08:17

Re: No jumping & attacking while freezed
 
Quote:

Originally Posted by PurposeLessx (Post 2545618)
I tried it.
PHP Code:

set_entvar(players[i], var_flagsget_entvar(players[i], var_flags) | FL_FROZEN); 

But they can still jump and attack everywhere and everyone.
I am trying it with bots. It can not block them because of they are bot, it can be?

Save their view angle when they spawn and set that angle on PreThink + fixangle 1. This will prevent them from turning.
For attacking, just set m_flNextPrimaryAttack.
For jumping, you can't properly block jump, it will still play a bit of the animation.

Depresie 09-01-2017 16:10

Re: No jumping & attacking while freezed
 
I think setting player's velocity to 0 in prethink will solve the player's jump issue..

wickedd 09-01-2017 16:44

Re: No jumping & attacking while freezed
 
Quote:

Originally Posted by Depresie (Post 2545884)
I think setting player's velocity to 0 in prethink will solve the player's jump issue..

Nope


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

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