AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved BEST way to reset player model ? ? (https://forums.alliedmods.net/showthread.php?t=314746)

SHIELD755 03-05-2019 05:33

BEST way to reset player model ? ?
 
hii , can anybody suggest me best way to reset player model if the player model set to coustom like

i am using a HERO plugin and after some time a randomly person choosen as hero and its model change to hero model with this command
PHP Code:

public hero(id)
{
g_HeroActive 1
cs_set_user_model
(idModel_Hero)


but the promblem is that how can i reset player default model after the death of hero or end of HERO event (g_heroactive = 0) , i tried by using
PHP Code:

public ondeath(id)
{
g_heroactive 0
cs_reset_user_model
(id)


but failed so can anybody help me :)

Natsheh 03-05-2019 05:39

Re: BEST way to reset player model ? ?
 
will it depends if the default model is a custom model or regural class model.

you can use cstrike module native >> cs_reset_user_model(index);

make sure also ondeath is called.

Celena Luna 03-05-2019 05:59

Re: BEST way to reset player model ? ?
 
you can also try reset model after player respawn instead of dead

PHP Code:

public ondeath(id

    if(
g_HeroActive)
        
g_HeroActive 
}

public 
fw_Player_Spawn_Post(id)
{
    
cs_reset_user_model(id



SHIELD755 03-05-2019 06:55

Re: BEST way to reset player model ? ?
 
Quote:

Originally Posted by Celena Luna (Post 2642032)
you can also try reset model after player respawn instead of dead

PHP Code:

public ondeath(id

    if(
g_HeroActive)
        
g_HeroActive 
}

public 
fw_Player_Spawn_Post(id)
{
    
cs_reset_user_model(id



THANKS , first time your code does not work but when i add "cs_reset_user_model(iVictim)" index with victim which is HERO than it works


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

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