Raised This Month: $32 Target: $400
 8% 

[HL2DM/ANY?] Fast spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Alienmario
Senior Member
Join Date: Aug 2013
Plugin ID:
4899
Plugin Version:
1.0
Plugin Category:
Gameplay
Plugin Game:
Half-Life 2 Deathmatch
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Faster respawns for players
    Old 11-13-2015 , 19:33   [HL2DM/ANY?] Fast spawn
    Reply With Quote #1

    Cvars:
    Quote:
    sm_fastspawn [default=1] Enables player respawn [sm_fastspawn_time] seconds after death
    sm_fastspawn_time [default=0.5] Sets how long to wait until player can respawn
    Attached Files
    File Type: sp Get Plugin or Get Source (fast_spawn.sp - 1189 views - 1.5 KB)
    Alienmario is offline
    Yaser2007
    Junior Member
    Join Date: May 2022
    Location: Iran
    Old 07-21-2022 , 09:00   Re: [HL2DM/ANY?] Fast spawn
    Reply With Quote #2

    Hi, this plugin has problem with spectator, can fix it?

    Last edited by Yaser2007; 08-25-2022 at 13:53.
    Yaser2007 is offline
    Grey83
    Veteran Member
    Join Date: Dec 2014
    Location: Ukraine
    Old 07-21-2022 , 09:31   Re: [HL2DM/ANY?] Fast spawn
    Reply With Quote #3

    Yaser2007, You can try this code:
    PHP Code:
    #pragma semicolon 1

    #include <sdktools_functions>

    public Plugin myinfo =
    {
        
    name "fastspawn",
        
    author "Alienmario",
        
    description ="fastspawn for players",
        
    version "1.1.0"
    }

    bool
        bEnable
    ;
    float
        fTime
    [MAXPLAYERS+1];

    public 
    OnPluginStart()
    {
        
    ConVar cvar;
        
    cvar CreateConVar("sm_fastspawn","1","Enables player respawn [sm_fastspawn_time] seconds after death"_true_true1.0);
        
    cvar.AddChangeHook(CVarChange_Enable);
        
    bEnable cvar.BoolValue;

        
    cvar CreateConVar("sm_fastspawn_time""0.5""Sets how long to wait until player can respawn"_true_true5.0);
        
    cvar.AddChangeHook(CVarChange_Time);
        
    fTime[0] = cvar.FloatValue;

        
    AutoExecConfig(true);

        
    HookEvent("player_death"Event_Death);
    }

    public 
    void CVarChange_Enable(ConVar cvar, const char[] oldValue, const char[] newValue)
    {
        
    bEnable cvar.BoolValue;
    }

    public 
    void CVarChange_Time(ConVar cvar, const char[] oldValue, const char[] newValue)
    {
        
    fTime[0] = cvar.FloatValue;
    }

    public 
    OnClientPutInServer(client)
    {
        
    fTime[client] = 0.0;
    }

    public 
    void OnPlayerRunCmdPost(int clientint buttons)
    {
        if(
    bEnable && buttons & (IN_ATTACK|IN_JUMP|IN_DUCK|IN_FORWARD|IN_BACK|IN_ATTACK2) && !IsPlayerAlive(client)
        && 
    GetClientTeam(client) > && GetGameTime() >= fTime[client])
            
    DispatchSpawn(client);
    }

    public 
    void Event_Death(Event event, const char[] namebool dontBroadcast)
    {
        
    int client GetClientOfUserId(event.GetInt("userid"));
        if(
    client && IsPlayerAlive(client)) fTime[client] = GetGameTime() + fTime[0];

    __________________

    Last edited by Grey83; 07-21-2022 at 09:31.
    Grey83 is offline
    Dr.Necro
    New Member
    Join Date: Oct 2022
    Old 10-11-2022 , 18:33   Re: [HL2DM/ANY?] Fast spawn
    Reply With Quote #4

    Unfortunately, that new code doesnt work on Black mesa server. Please Help
    Dr.Necro is offline
    Reply



    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


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


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