Raised This Month: $ Target: $400
 0% 

[SOLVED] My own spawn protection


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-07-2009 , 11:35   [SOLVED] My own spawn protection
Reply With Quote #1

I've registered
PHP Code:
public fwHamSpawn id )
{
    if ( ( 
get_roundtime >= ) && ( is_user_alive id ) )
    {
        
set_user_godmode id)
    } 
    else 
    {
        
set_user_godmode id)
    }

wrong. Is it better with a task?
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.

Last edited by TitANious; 06-07-2009 at 11:53.
TitANious is offline
Send a message via MSN to TitANious
Dr.G
Senior Member
Join Date: Nov 2008
Old 06-07-2009 , 11:38   Re: My own spawn protection
Reply With Quote #2

maybe this will help ya http://www.dodplugins.net/forums/showthread.php?t=1546
__________________
Dr.G is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 06-07-2009 , 11:50   Re: My own spawn protection
Reply With Quote #3

You can do this a number of ways.

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

new g_MaxPlayers;
new 
g_FreezeTime;

#define IsPlayer(%1)  ( 1 <= %1 <= g_MaxPlayers ) 

public plugin_init()  
{
    
register_plugin"Spawn Protection""1.0""bugsy" );
    
    
RegisterHamHam_TakeDamage"player""fw_HamTakeDamage" );
    
    
register_event"HLTV" "NewRound" "a" "1=0" "2=0" );
    
register_logevent"RoundStart" "1=Round_Start" );
    
    
g_MaxPlayers get_maxplayers();
}

public 
NewRound()
{
    
g_FreezeTime 1;
}

public 
RoundStart()
{
    
g_FreezeTime 0;
}

public 
fw_HamTakeDamage( const iVictim, const iAttacker, const iInflictor, const FloatfDamage, const iDamageBits )
{     
    return ( 
g_FreezeTime && IsPlayeriAttacker ) ) ? HAM_SUPERCEDE HAM_IGNORED;

__________________
Bugsy is offline
TitANious
Veteran Member
Join Date: Feb 2009
Location: Denmark
Old 06-07-2009 , 11:52   Re: My own spawn protection
Reply With Quote #4

This simple it got
PHP Code:
// Spawn Protection
public fwHamSpawn id )
{
    if ( 
is_user_alive id ) )
    {
        
set_user_godmode id)
        
set_task 4.0"RemoveSpawnProtection")
    }
}

public 
RemoveSpawnProtection id )
{
    
set_user_godmode id)

Thanks all it should now be [SOLVED]
__________________
I dislike this.

"A sneeze never comes alone!" <-- Important to remember.
TitANious is offline
Send a message via MSN to TitANious
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 06-07-2009 , 12:51   Re: [SOLVED] My own spawn protection
Reply With Quote #5

Godmode not ok Block damage from players - ok.
__________________
xPaw 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 13:48.


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