Raised This Month: $51 Target: $400
 12% 

Spawn Protection


Post New Thread Reply   
 
Thread Tools Display Modes
Apollyon
SourceMod Donor
Join Date: Dec 2007
Location: California
Old 12-18-2009 , 07:31   Re: Spawn Protection
Reply With Quote #361

Can someone add a cvar to allow spawn protection for only CT or T teams? Or make it so only human players get spawn protection... not bots?

Edit: Nevermind, I figured it out.
__________________

Last edited by Apollyon; 12-18-2009 at 16:47.
Apollyon is offline
RHysell
New Member
Join Date: Mar 2010
Old 03-12-2010 , 14:33   Re: Spawn Protection
Reply With Quote #362

Quote:
Originally Posted by Peli View Post
NEWS
*6 December 2005* Re-Releasing Version 7.0
*4 December 2005* Thanks to VEN and Avalanche, the plugin should work fine now.
*28 December 2005* Thanks to Podunk there is a new cvar for controlling shell thickness.
*16 April 06* Thanks to SubStream for testing, the plugin now works.


TO-DO LIST
  • (Public Testing) Adding a new feature: Players can select what color they would like to glow during Spawn Protection Time.
PLUGIN STATUS
Version 7.0 Compiles fine, Tested - works fine.

PLUGIN
Code:
   
   CREDITS :
      Thanks to Xeroblood, JJkiller, KingPin for helping me make
      this plugin and Firestorm for helping adding a lot of things
 
   INSTALLING :
      Download .SMA to Scripting folder, run compiler, copy the
      file from Compiled folder and paste in Plugins folder, add the plugin name
      in the Amxx plugins.ini ie : spawnprotection.amxx
 
   DESCRIPTION :
      Protects players when the spawn from being killed
 
   CHANGELOG :
      Version 1.0 - First Release
      Version 2.0 - Fixed godmode cvar problems
      Version 3.0 - Added message time control cvar
      Version 4.0 - Fixed errors
      Version 5.0 - Added message control cvar
      Version 6.0 - Fixed errors - THANKS VEN!
      Version 7.0 - Cleaned up plugin and fixed errors - THANKS
                          AVALANCHE, VEN and SubStream
      Version 8.0 - Testing
RHysell is offline
RHysell
New Member
Join Date: Mar 2010
Old 03-12-2010 , 14:35   Re: Spawn Protection
Reply With Quote #363

I tried this Plugin and it does work, But as for the bots, they spawn continues thur out game, with out being killed, I guess plugin does not work with Bots

Or do they
RHysell is offline
RHysell
New Member
Join Date: Mar 2010
Old 03-13-2010 , 10:08   Re: Spawn Protection
Reply With Quote #364

Quote:
Originally Posted by Apollyon View Post
Can someone add a cvar to allow spawn protection for only CT or T teams? Or make it so only human players get spawn protection... not bots?

Edit: Nevermind, I figured it out.
Share the wealth, Let someone else in on the fix..
RHysell is offline
Apollyon
SourceMod Donor
Join Date: Dec 2007
Location: California
Old 03-13-2010 , 12:11   Re: Spawn Protection
Reply With Quote #365

This is what I am using. I stripped out some of the original functions and made a few changes for my own use. This works with CZ bots.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>

new sv_sptimesv_spmessagesv_spshellthicksv_spglow

new bool:gBotsRegistered;

public 
plugin_init() {
    
register_plugin("Spawn Protection""7.0""Peli")
    
RegisterHam(Ham_Spawn"player""PlayerSpawn"1);
    
    
sv_sptime register_cvar("sv_sptime""5"
    
sv_spmessage register_cvar("sv_spmessage""1"
    
sv_spshellthick register_cvar("sv_spshellthick""25"
    
sv_spglow register_cvar("sv_spglow""1"
}

public 
client_authorized(id)
    if(!
gBotsRegistered && is_user_bot(id))
{
    
    
set_task(0.1"register_bots"id);
}

public 
register_bots(id)
{
    if(!
gBotsRegistered && is_user_connectedid ))
    {
        
RegisterHamFromEntityHam_Spawnid"PlayerSpawn"1);
        
gBotsRegistered true;
    }
}

public 
client_disconnect(id)
{
    
remove_task(id)
    return 
PLUGIN_HANDLED
}

public 
PlayerSpawn(id)
{
    if(
is_user_alive(id))
    {
        
set_task(0.1"protect"id);
    }
}

public 
protect(id
{
    new 
Float:SPTime get_pcvar_float(sv_sptime)
    new 
SPShell get_pcvar_num(sv_spshellthick)
    
set_user_godmode(id1)
    
    if(
get_pcvar_num(sv_spglow)) { 
        
        if(
get_user_team(id) == 1)
        {
            
set_user_rendering(idkRenderFxGlowShell25500kRenderNormalSPShell)
        }
        
        if(
get_user_team(id) == 2)
        {
            
set_user_rendering(idkRenderFxGlowShell00255kRenderNormalSPShell)
        }
    }
    
    if(
get_pcvar_num(sv_spmessage) == 1)
    {
        
set_hudmessage(25511, -1.00.306.0SPTime0.10.24)
        
show_hudmessage(id"** Spawn Protection is Active **")
    }
    
    
set_task(SPTime"sp_off"id)
    return 
PLUGIN_HANDLED
}

public 
sp_off(id
{
    if(!
is_user_connected(id))
    {
        return 
PLUGIN_HANDLED
    
}
    
    else
    {
        
set_user_godmode(id0)     
        
set_user_rendering(idkRenderFxGlowShell00,0kRenderNormal0)
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_HANDLED

__________________
Apollyon is offline
ditmesteam
Senior Member
Join Date: Oct 2009
Old 03-14-2010 , 22:11   Re: Spawn Protection
Reply With Quote #366

Does plugins make the same with anti-reconnect?
ditmesteam is offline
~ScORpY
Senior Member
Join Date: Sep 2009
Location: Norway, bergen
Old 05-29-2010 , 14:33   Re: Spawn Protection
Reply With Quote #367

why do i have to do sv_sp 1 in consolle for it to work?

shouldnt that be auto? :S
__________________
~ScORpY is offline
luxyaself
Junior Member
Join Date: Aug 2010
Old 08-30-2010 , 09:21   Re: Spawn Protection
Reply With Quote #368

Edited Apollyons version so that std spawnprotection is set to 1 sec and it shows a green "[SP]" on the left side of the ingame HUD as long as you are protected.
Works perfectly fine with bots@DM!

Screen: http://img90.**************/i/csoffice0000p.jpg/
Amxx: http://www.team-amaya.de/SpawnprotetionLXE.zip

Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>

new sv_sptime, sv_spmessage, sv_spshellthick, sv_spglow

new bool:gBotsRegistered;

public plugin_init() {
    register_plugin("Spawn Protection", "7.0", "Peli")
    RegisterHam(Ham_Spawn, "player", "PlayerSpawn", 1);
    
    sv_sptime = register_cvar("sv_sptime", "1") 
    sv_spmessage = register_cvar("sv_spmessage", "1") 
    sv_spshellthick = register_cvar("sv_spshellthick", "75") 
    sv_spglow = register_cvar("sv_spglow", "1") 
}

public client_authorized(id)
    if(!gBotsRegistered && is_user_bot(id))
{
    
    set_task(0.1, "register_bots", id);
}

public register_bots(id)
{
    if(!gBotsRegistered && is_user_connected( id ))
    {
        RegisterHamFromEntity( Ham_Spawn, id, "PlayerSpawn", 1);
        gBotsRegistered = true;
    }
}

public client_disconnect(id)
{
    remove_task(id)
    return PLUGIN_HANDLED
}

public PlayerSpawn(id)
{
    if(is_user_alive(id))
    {
        set_task(0.1, "protect", id);
    }
}

public protect(id) 
{
    new Float:SPTime = get_pcvar_float(sv_sptime)
    new SPShell = get_pcvar_num(sv_spshellthick)
    set_user_godmode(id, 1)
    
    if(get_pcvar_num(sv_spglow)) { 
        
        if(get_user_team(id) == 1)
        {
            set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, SPShell)
        }
        
        if(get_user_team(id) == 2)
        {
            set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, SPShell)
        }
    }
    
    if(get_pcvar_num(sv_spmessage) == 1)
    {
        set_hudmessage(0, 255, 1, -2.0, 0.50, 0, 6.0, SPTime, 0.1, 0.2, 3)
        show_hudmessage(id, "  [SP]", SPTime)
    }
    
    set_task(SPTime, "sp_off", id)
    return PLUGIN_HANDLED
}

public sp_off(id) 
{
    if(!is_user_connected(id))
    {
        return PLUGIN_HANDLED
    }
    
    else
    {
        set_user_godmode(id, 0)     
        set_user_rendering(id, kRenderFxGlowShell, 0, 0,0, kRenderNormal, 0)
        return PLUGIN_HANDLED
    }
    
    return PLUGIN_HANDLED
}
luxyaself is offline
jbonzsito
Junior Member
Join Date: Jun 2010
Old 09-16-2010 , 17:39   Re: Spawn Protection
Reply With Quote #369

how do I remove the glow?
jbonzsito is offline
bmann_420
AMX_Super Pooper
Join Date: Jan 2005
Location: [SuperCentral.co]
Old 09-20-2010 , 19:30   Re: Spawn Protection
Reply With Quote #370

Read the cvars, add them to your amxx.cfg, with the settings you want.
__________________
bmann_420 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 10:10.


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