AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Run Effect (https://forums.alliedmods.net/showthread.php?t=182843)

DavidJr 04-14-2012 06:22

Run Effect
 
I want to make a plugin that if we walk there is a shake effect on the weapon model.. is it right?

Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <engine>

#define PLUGIN "UnKnown."
#define VERSION "1.0"
#define AUTHOR ""

public plugin_init()
{
    register_plugin("run effect","1.0","SubFive")
    register_clcmd("bind "s","cmd_run",ADMIN_USER)
}

public WALKMOVE_NORMAL(id)
{
    {
        set_animation(id, 7)
        set_task(1.2, "revert_back", id)
    }
}

public revert_back(id)
{
    client_cmd(id, "lastinv")
}

public set_animation( id, seq )
{
    entity_set_int(id, EV_INT_weaponanim, seq);
    message_begin(MSG_ONE, SVC_WEAPONANIM, {0,0,0}, id);
    write_byte(seq);
    write_byte(entity_get_int(id, EV_INT_body));
    message_end();
}


Arkshine 04-14-2012 06:24

Re: Run Effect
 
What do you mean by a shake effect ?

DavidJr 04-14-2012 06:27

Re: Run Effect
 
it's hard to explain :( but when we run there's an effect on the view model like this video http://www.youtube.com/watch?v=NkMzR8AjWyc

Arkshine 04-14-2012 06:38

Re: Run Effect
 
Not sure what effect you're talking about. Maybe the movement up/down ? In CS you have similar effect but more forward/backward. Anyway you can't do nothing that's something fully handled on the client and unrelated to the weapon animations.

DavidJr 04-14-2012 06:47

Re: Run Effect
 
Quote:

Originally Posted by Arkshine (Post 1688876)
Not sure what effect you're talking about. Maybe the movement up/down ? In CS you have similar effect but more forward/backward. Anyway you can't do nothing that's something fully handled on the client and unrelated to the weapon animations.

Yes ! :D The movement.. i've make the animation :D is there any plugin to set the animation when run walk and duck?

DavidJr 04-15-2012 01:56

Re: Run Effect
 
Code:

/* Plugin generated by AweaMXX-Studio */

#include <amxmodx>
#include <engine>

#define PLUGIN "UnKnown."
#define VERSION "1.0"
#define AUTHOR ""


get_weaponid (weapon_mp5[get_weaponid ],native)

stock set_entity_anim( ent, anim )
{
    if( pev_valid( ent ) )
    {
        entity_set_float( ent, EV_FL_animtime, get_gametime( ) );
        entity_set_float( ent, EV_FL_framerate, 1.0 );
        entity_set_int( ent, EV_INT_sequence, anim );
    }     
}

I'm trying to make a plugin that play a sequence when walk :(

Arkshine 04-15-2012 03:59

Re: Run Effect
 
You have made a sequence inside a weapon, you have to use SVC_WEAPONANIM.

DavidJr 04-16-2012 00:51

Re: Run Effect
 
How to add SVC_WEAPONANIM to that code? thank you very much for your help :) i'm sorry :(

DavidJr 04-16-2012 00:54

Re: Run Effect
 
Code:

/* Plugin generated by AweaMXX-Studio */

#include <amxmodx>
#include <engine>

#define PLUGIN "UnKnown."
#define VERSION "1.0"
#define AUTHOR ""


get_weaponid (weapon_mp5[get_weaponid ],native)

stock set_entity_anim( ent, anim )
{
    if( pev_valid( ent ) )
    {
        entity_set_float( ent, EV_FL_animtime, get_gametime( ) );
        entity_set_float( ent, EV_FL_framerate, 1.0 );
        entity_set_int( ent, EV_INT_sequence, anim );
    }     
}
public set_animation( id, seq )
{
    entity_set_int(id, EV_INT_weaponanim, seq);
    message_begin(MSG_ONE, SVC_WEAPONANIM, {0,0,0}, id);
    write_byte(seq);
    write_byte(entity_get_int(id, EV_INT_body));
    message_end();
}

Like this? :D

DavidJr 04-16-2012 03:40

Re: Run Effect
 
it doesn't work


All times are GMT -4. The time now is 07:46.

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