AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Respawn player without Animation (https://forums.alliedmods.net/showthread.php?t=189774)

Trickzz 07-10-2012 17:58

Respawn player without Animation
 
How to do that would be the death of the body vanished and death animation player

Code:

public respawn_player(id)
{
    // Disconnected, already spawned, or switched to Spectator
    if (!is_user_connected(id) || is_user_alive(id) || cs_get_user_team(id) == CS_TEAM_SPECTATOR)
        return;
       
    // Try to spawn the player setting the appropiate dead flag and forcing a think
    set_pev(id, pev_deadflag, DEAD_RESPAWNABLE, EF_NODRAW)
    dllfunc(DLLFunc_Think, id)
   
    // Fix for CZ Bots: DLLFunc_Think won't work on them,
    // but DLLFunc_Spawn does the job without any bugs.
    // (for some reason I'm not suprised...)
    if (is_user_bot(id) && pev(id, pev_deadflag) == DEAD_RESPAWNABLE)
    {
        dllfunc(DLLFunc_Spawn, id)
    }
}



All times are GMT -4. The time now is 15:13.

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