AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Restore model after hiding it (https://forums.alliedmods.net/showthread.php?t=220195)

Randomize 07-08-2013 05:12

Restore model after hiding it
 
1. I was trying to hide model when first zoom and it succeed, but how to restore it? Also how to user set_pev? :D
2. There's a problem when first zoom. I hide the model for first zoom but when I was shooting, it didn't play the sound.

PHP Code:

    g_iViewModel[id] = pev(idpev_viewmodel)
    if (
pev(id,pev_button) & IN_ATTACK2 && (get_user_weapon(id) == CSW_AWP || get_user_weapon(id) == CSW_SCOUT || get_user_weapon(id) == CSW_SG550 || get_user_weapon(id) == CSW_G3SG1) && cs_get_user_zoom(id) == CS_SET_FIRST_ZOOM)
    {
        
set_user_maxspeed(id210.0)
        
set_pev(idpev_viewmodel0)
    }
    if (
pev(id,pev_button) & IN_ATTACK2 && (get_user_weapon(id) == CSW_AWP || get_user_weapon(id) == CSW_SG550 || get_user_weapon(id) == CSW_G3SG1) && cs_get_user_zoom(id) == CS_SET_SECOND_ZOOM)
    {
        
cs_set_user_zoom(idCS_SET_NO_ZOOM1)
        
set_user_maxspeed(id210.0)
        
set_pev(idpev_viewmodelg_iViewModel[id])
    }
    else if (
pev(id,pev_button) & IN_ATTACK2 && get_user_weapon(id) == CSW_SCOUT && cs_get_user_zoom(id) == CS_SET_SECOND_ZOOM)
    {
        
cs_set_user_zoom(idCS_SET_NO_ZOOM1)
        
set_user_maxspeed(id260.0)
        
set_pev(idpev_viewmodelg_iViewModel[id])
    } 


baneado 07-08-2013 14:02

Re: Restore model after hiding it
 
use fm_cs_get_current_weapon_ent

then make the entity invisible and visible, I think will work.


All times are GMT -4. The time now is 06:20.

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