AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   set_pev model restart (https://forums.alliedmods.net/showthread.php?t=144292)

Tonda 12-01-2010 16:33

set_pev model restart
 
Hi all i have script

set_pev(id, pev_viewmodel2, _MODEL1)

but i have function and you can turn off this model. But you must change weapon and after this you have default skin.

How can i restart (give default) set_pev model for player?

Exolent[jNr] 12-01-2010 16:48

Re: set_pev model restart
 
Save the original model before you replace it with a custom one.

Tonda 12-01-2010 16:51

Re: set_pev model restart
 
Quote:

Originally Posted by Exolent[jNr] (Post 1361075)
Save the original model before you replace it with a custom one.

Save original? Original is a default in the CS .... why save? i need only reset

Exolent[jNr] 12-01-2010 16:54

Re: set_pev model restart
 
Quote:

Originally Posted by Tonda (Post 1361079)
Save original? Original is a default in the CS .... why save? i need only reset

Save the path of it in an array. I don't mean save the .mdl file.

ConnorMcLeod 12-02-2010 01:31

Re: set_pev model restart
 
You can also force the weapon to deploy again, you need to retrieve active weapon entity index and send Ham_Deploy on it.

madeitout 12-02-2010 04:19

Re: set_pev model restart
 
PHP Code:

switch (get_user_weapon(id__))
{
    case 
CSW_AWPset_pev(idpev_viewmodel2"models/v_awp.mdl");
    case 
CSW_USPset_pev(idpev_viewmodel2"models/v_usp.mdl");



you will need to fill in the rest of the cases for each weapon for it to be complete

PHP Code:

/* Id of weapons in CS */
#define CSW_P228        1
#define CSW_SCOUT        3
#define CSW_HEGRENADE        4
#define CSW_XM1014        5
#define CSW_C4            6
#define CSW_MAC10        7
#define CSW_AUG            8
#define CSW_SMOKEGRENADE    9
#define CSW_ELITE        10
#define CSW_FIVESEVEN        11
#define CSW_UMP45        12
#define CSW_SG550        13
#define CSW_GALI        14
#define CSW_GALIL        14
#define CSW_FAMAS        15
#define CSW_USP            16
#define CSW_GLOCK18        17
#define CSW_AWP            18
#define CSW_MP5NAVY        19
#define CSW_M249        20
#define CSW_M3            21
#define CSW_M4A1        22
#define CSW_TMP            23
#define CSW_G3SG1        24
#define CSW_FLASHBANG        25
#define CSW_DEAGLE        26
#define CSW_SG552        27
#define CSW_AK47        28
#define CSW_KNIFE        29
#define CSW_P90            30
#define CSW_VEST        31
#define CSW_VESTHELM    32 


Exolent[jNr] 12-02-2010 05:00

Re: set_pev model restart
 
Quote:

Originally Posted by madeitout (Post 1361310)
PHP Code:

switch (get_user_weapon(id__))
{
    case 
CSW_AWPset_pev(idpev_viewmodel2"models/v_awp.mdl");
    case 
CSW_USPset_pev(idpev_viewmodel2"models/v_usp.mdl");



you will need to fill in the rest of the cases for each weapon for it to be complete

PHP Code:

/* Id of weapons in CS */
#define CSW_P228        1
#define CSW_SCOUT        3
#define CSW_HEGRENADE        4
#define CSW_XM1014        5
#define CSW_C4            6
#define CSW_MAC10        7
#define CSW_AUG            8
#define CSW_SMOKEGRENADE    9
#define CSW_ELITE        10
#define CSW_FIVESEVEN        11
#define CSW_UMP45        12
#define CSW_SG550        13
#define CSW_GALI        14
#define CSW_GALIL        14
#define CSW_FAMAS        15
#define CSW_USP            16
#define CSW_GLOCK18        17
#define CSW_AWP            18
#define CSW_MP5NAVY        19
#define CSW_M249        20
#define CSW_M3            21
#define CSW_M4A1        22
#define CSW_TMP            23
#define CSW_G3SG1        24
#define CSW_FLASHBANG        25
#define CSW_DEAGLE        26
#define CSW_SG552        27
#define CSW_AK47        28
#define CSW_KNIFE        29
#define CSW_P90            30
#define CSW_VEST        31
#define CSW_VESTHELM    32 


Or simply do what Connor said.

Quote:

Originally Posted by ConnorMcLeod (Post 1361278)
You can also force the weapon to deploy again, you need to retrieve active weapon entity index and send Ham_Deploy on it.

Code:
#include < hamsandwich > #define m_pActiveItem 373 ResetViewModel( iPlayer ) {     new iEntity = get_pdata_cbase( iPlayer, m_pActiveItem, 5 );     if( iEntity > 0 )     {         ExecuteHamB( Ham_Item_Deploy, iEntity );     } }

ConnorMcLeod 12-02-2010 12:04

Re: set_pev model restart
 
Could even save weapons delays before deploy and set them back after, and update animation as well.


All times are GMT -4. The time now is 11:25.

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