Page 1 of 2

freeze

Posted: 2012 Apr 02 11:17
by nuodas159
Kaip padaryti kad žaidėjas negalėtų judėti bet galėtų šaudyti?

Re: freeze

Posted: 2012 Apr 02 11:52
by xFrostas

Code: Select all

        entity_set_int(id, EV_INT_flags, Flags | FL_FROZEN)

Re: freeze

Posted: 2012 Apr 02 13:44
by nuodas159
xFrostas wrote:

Code: Select all

        entity_set_int(id, EV_INT_flags, Flags | FL_FROZEN)
Bet ,kad jis šaudyti neleidžia...

Re: freeze

Posted: 2012 Apr 02 13:46
by aaarnas
set_user_maxspeed(id, 0.1)

Re: freeze

Posted: 2012 Apr 02 13:48
by nuodas159
Mhm, šitas kartais leis šokinėti arba duckinti?

Re: freeze

Posted: 2012 Apr 02 13:49
by aaarnas
Leis. Tada reikės mygtukus blokuoti.

Re: freeze

Posted: 2012 Apr 02 13:49
by nuodas159
Gal galėtum parašyti pvz?

Re: freeze

Posted: 2012 Apr 02 13:52
by aaarnas

Code: Select all

/* Plugin generated by AMXX-Studio */ #include <amxmodx>#include <fakemeta> #define PLUGIN "New Plug-In"#define VERSION "1.0"#define AUTHOR "aaarnas"  public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR)        register_forward(FM_CmdStart, "forward_cmdstart")} public forward_cmdstart(id, uc_handle) {        static button    button = get_uc(uc_handle, UC_Buttons)        if(button & IN_JUMP) button &= ~IN_JUMP    if(button & IN_DUCK) button &= ~IN_DUCK    if(button & IN_FORWARD) button &= ~IN_FORWARD    if(button & IN_BACK) button &= ~IN_BACK    if(button & IN_MOVELEFT) button &= ~IN_MOVELEFT    if(button & IN_MOVERIGHT) button &= ~IN_MOVERIGHT        set_uc(uc_handle, UC_Buttons, button)}

Re: freeze

Posted: 2012 Apr 02 13:53
by nuodas159
Dėkui +karma. :)

Re: freeze

Posted: 2012 Apr 02 14:11
by hleV
Nebūtina tikrint, ar žaidėjas spaudžia tam tikrus mygtukus, kad juos pašalint. Be to, IN_LEFT -> IN_MOVELEFT, IN_RIGHT -> IN_MOVERIGHT.

Code: Select all

set_uc(uc_handle, UC_Buttons, get_uc(uc_handle, UC_Buttons) & ~IN_JUMP & ~IN_DUCK & ~IN_FORWARD & ~IN_BACK & ~IN_MOVELEFT & ~IN_MOVERIGHT);
Nors nežinau, ar tai užblokuos jūdėjimą/šokinėjimą. Bent jau per ESF tai ne.