AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Ducking (https://forums.alliedmods.net/showthread.php?t=95018)

ƒa†es™ 06-18-2009 14:03

[Help] Ducking
 
Is there anyway i can force a user to duck forever ?

stupok 06-19-2009 00:02

Re: [Help] Ducking
 
You can try forcing the command +duck, but the user will be able to unduck by executing -duck. So, to make him duck "forever", you would have to spam the command.

Exolent[jNr] 06-19-2009 00:53

Re: [Help] Ducking
 
Code:
#include <amxmodx> #include <amxmisc> #include <engine> public plugin_init() {     register_plugin("Always Ducking", "0.1", "Exolent"); } public client_PreThink(client) {     if( is_user_alive(client) )     {         static iFlags;         if( !((iFlags = entity_get_int(client, EV_INT_flags)) & FL_DUCKING) )         {             entity_set_int(client, EV_INT_flags, iFlags | FL_DUCKING);             entity_set_size(client, Float:{-16.0, -16.0, -18.0}, Float:{16.0, 16.0, 18.0});         }     } }

ƒa†es™ 06-19-2009 02:58

Re: [Help] Ducking
 
Quote:

Originally Posted by Exolent[jNr] (Post 852066)
Code:
#include <amxmodx></p><p>#include <amxmisc></p><p>#include <engine></p><p>&nbsp;</p><p>public plugin_init()</p><p>{</p><p> register_plugin("Always Ducking", "0.1", "Exolent");</p><p>}</p><p>&nbsp;</p><p>public client_PreThink(client)</p><p>{</p><p> if( is_user_alive(client) )</p><p> {</p><p> static iFlags;</p><p> if( !((iFlags = entity_get_int(client, EV_INT_flags)) & FL_DUCKING) )</p><p> {</p><p> entity_set_int(client, EV_INT_flags, iFlags | FL_DUCKING);</p><p> entity_set_size(client, Float:{-16.0, -16.0, -18.0}, Float:{16.0, 16.0, 18.0});</p><p> }</p><p> }</p><p>}


thanks anyway but doesn't work correctly

it forcing the user to slow walk.... :cry: not ever a duck.

ƒa†es™ 06-19-2009 03:00

Re: [Help] Ducking
 
Quote:

Originally Posted by stupok (Post 852042)
You can try forcing the command +duck, but the user will be able to unduck by executing -duck. So, to make him duck "forever", you would have to spam the command.

How do i spam the command ?

SnoW 06-19-2009 03:06

Re: [Help] Ducking
 
You could try set_pev( index, pev_bInDuck, 1 ); in prethink, tho I think it'll still like kinda dance, lol.

Anggara_nothing 06-19-2009 03:07

Re: [Help] Ducking
 
Quote:

Originally Posted by stupok (Post 852042)
You can try forcing the command +duck, but the user will be able to unduck by executing -duck. So, to make him duck "forever", you would have to spam the command.

Quote:

#include <amxmodx>
#include <engine>

#define PLUGIN "Helping lol people. =.="
#define VERSION "1.0"
#define AUTHOR "Anggara_nothing"


public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

// Add your code here...
}

public client_PreThink(client)
{
if( is_user_alive(client) )
client_cmd(client, "+duck")
set_pev(client, pev_bInDuck, 1)
}

ƒa†es™ 06-19-2009 03:15

Re: [Help] Ducking
 
I have a question what does should return to value ?

PHP Code:

return PLUGIN_CONTINUE 

?

Like this :

PHP Code:

public client_PreThink(id)
{
    if (!
zp_get_user_zombie(id) || zp_get_user_nemesis(id))
   return 
PLUGIN_CONTINUE

    
if (zp_get_user_zombie_class(id) != g_zclass_hczombie)
   return 
PLUGIN_CONTINUE

    client_cmd
(id"-duck")
    
set_pev(idpev_bInDuck1)



Anggara_nothing 06-19-2009 03:16

Re: [Help] Ducking
 
PHP Code:

public client_PreThink(id)
{
  if (!
zp_get_user_zombie(id) || zp_get_user_nemesis(id))
   return 
PLUGIN_CONTINUE
  
if (zp_get_user_zombie_class(id) != g_zclass_hczombie)
   return 
PLUGIN_CONTINUE

  client_cmd
(id"-duck")
  
set_pev(idpev_bInDuck1)
  return 
PLUGIN_CONTINUE;



ƒa†es™ 06-19-2009 03:36

Re: [Help] Ducking
 
Quote:

Originally Posted by SnoW (Post 852129)
You could try set_pev( index, pev_bInDuck, 1 ); in prethink, tho I think it'll still like kinda dance, lol.

It just like a player spamming duck key.

I want it just like a player holding duck key.


All times are GMT -4. The time now is 15:35.

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