AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Reset view model and block knife attack 2. (https://forums.alliedmods.net/showthread.php?t=82509)

xbatista 12-24-2008 17:36

Reset view model and block knife attack 2.
 
1.How to reset set_pev(viewmodel) example like in fakemeta stock:fm_reset_user_model.?
2.How to block knife attack 2.?

Dores 12-24-2008 17:59

Re: Reset view model and block knife attack 2.
 
1)

PHP Code:

new g_szVModel33 ][ 62 ];

// [...]

public changeViewModelFunctionid )
{
    
pevidpev_viewmodel2g_szVModelid ], sizeof g_szVModel[] ); // I like using viewmodel2 so I don't have to allocate the model string.
    
set_pevidpev_viewmodel2"models/other_viewmodel_here.mdl" );
}

stock fm_reset_user_viewmodelindex )
{
    
set_pevidpev_viewmodel2g_szVModelindex ] );
}

public 
client_disconnectid )
{
    
g_szVModelid ][ ] = '^0'// Clear array.


2)

PHP Code:

public plugin_init()
{
//    [...]
    
register_forwardFM_CmdStart"Forward_CmdStart" );
}

public 
Forward_CmdStartiduc_handleseed )
{
    static 
Button Button get_ucuc_handleUC_Buttons );
    
    if( 
Button IN_ATTACK2 )
    {
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED:



xbatista 12-25-2008 05:04

Re: Reset view model and block knife attack 2.
 
WOW,again you . tHX!!

EDIT: 2. Not works.Maybe you don't check if this a knife? :mrgreen:
1.Not tested yet.

ConnorMcLeod 12-25-2008 05:31

Re: Reset view model and block knife attack 2.
 
What you mean by "reset" model, also witch model are you talking about ?

xbatista 12-25-2008 05:34

Re: Reset view model and block knife attack 2.
 
Model about knife, something like this:
PHP Code:

stock fm_reset_user_model(player)
{
    
// Player doesn't have a custom model any longer
    
g_has_custom_model[player] = false
    
    dllfunc
(DLLFunc_ClientUserInfoChangedplayerengfunc(EngFunc_GetInfoKeyBufferplayer))


But reset a weapon models.
Stock.

ConnorMcLeod 12-25-2008 06:02

Re: Reset view model and block knife attack 2.
 
Depends on what plugin you use to set player knife model.

Dores 12-25-2008 06:17

Re: Reset view model and block knife attack 2.
 
Sorry, you're right.
PHP Code:

#include <fakemeta>

public plugin_init()
{
//    [...]
    
register_forwardFM_CmdStart"Forward_CmdStart" );
}

public 
Forward_CmdStartiduc_handleseed )
{
    static 
Button Button get_ucuc_handleUC_Buttons );
//  If the above line doesn't work, try this:
    
static Button get_ucuc_handleUC_ButtonsButton );
    
    if( ( 
Button IN_ATTACK2 ) && get_user_weaponid ) == CSW_KNIFE )
    {
        return 
FMRES_SUPERCEDE;
    }
    
    return 
FMRES_IGNORED:



xbatista 12-25-2008 06:19

Re: Reset view model and block knife attack 2.
 
@CONNOR:
yes knife model.
@Dores ok. :)
And please fix that problem that you sayied :()
http://forums.alliedmods.net/showthr...t=82424&page=2

EDIT: Tested, still not blocking attack2,tryied that 2 lines.

ConnorMcLeod 12-25-2008 08:27

Re: Reset view model and block knife attack 2.
 
PHP Code:

#include <fakemeta>

public plugin_init()
{
//    [...]
    
register_forwardFM_CmdStart"Forward_CmdStart" );
}

public 
Forward_CmdStartiduc_handleseed )
{
    static 
Buttons Buttons get_ucuc_handleUC_Buttons );
    
    if( ( 
Button IN_ATTACK2 ) && get_user_weaponid ) == CSW_KNIFE )
    {
        
set_ucuc_handleUC_ButtonsButton & ~IN_ATTACK2 )
    }




Witch model plugin ??!

xbatista 12-25-2008 08:33

Re: Reset view model and block knife attack 2.
 
viewmodel.Knife model.
P.S.Will try block attack2.


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

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