Raised This Month: $ Target: $400
 0% 

[REQ] After round starts join slay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
erader
Senior Member
Join Date: Dec 2010
Old 06-16-2011 , 02:46   [REQ] After round starts join slay
Reply With Quote #1

Hi.
I need a plugin that slay those players who join the server after the round start.
Thanks!
__________________
If you live for something, you're not alone my friend...
erader is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-16-2011 , 06:56   Re: [REQ] After round starts join slay
Reply With Quote #2

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

// how many seconds after round start are players allowed to spawn 
#define ALLOWED_SPAWN_SECONDS 15 

new Float:g_fRoundStart

public 
plugin_init( ) { 
    
register_plugin"Anti-LateSpawn""0.0.1""Exolent" ); 
     
    
register_logevent"EventRoundStart"2"1=Round_Start" ); 
     
    
RegisterHamHam_Spawn"player""FwdPlayerSpawnPost"); 


public 
EventRoundStart( ) { 
    
g_fRoundStart get_gametime( ); 


public 
FwdPlayerSpawnPostiPlayer ) { 
    if( 
is_user_aliveiPlayer 
    && 
get_gametime( ) > ( g_fRoundStart ALLOWED_SPAWN_SECONDS ) ) { 
        
user_silentkilliPlayer ); 
         
        
client_printiPlayerprint_chat"You spawned too late into the round." ); 
    } 

</span></span>
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
erader
Senior Member
Join Date: Dec 2010
Old 06-16-2011 , 14:06   Re: [REQ] After round starts join slay
Reply With Quote #3

Quote:
Originally Posted by drekes View Post
PHP Code:
#include < amxmodx > 
#include < hamsandwich > 

// how many seconds after round start are players allowed to spawn 
#define ALLOWED_SPAWN_SECONDS 15 

new Float:g_fRoundStart

public 
plugin_init( ) { 
    
register_plugin"Anti-LateSpawn""0.0.1""Exolent" ); 
     
    
register_logevent"EventRoundStart"2"1=Round_Start" ); 
     
    
RegisterHamHam_Spawn"player""FwdPlayerSpawnPost"); 


public 
EventRoundStart( ) { 
    
g_fRoundStart get_gametime( ); 


public 
FwdPlayerSpawnPostiPlayer ) { 
    if( 
is_user_aliveiPlayer 
    && 
get_gametime( ) > ( g_fRoundStart ALLOWED_SPAWN_SECONDS ) ) { 
        
user_silentkilliPlayer ); 
         
        
client_printiPlayerprint_chat"You spawned too late into the round." ); 
    } 

</span></span>
Thank you but it has a bug: when the round starts all players are killed...
__________________
If you live for something, you're not alone my friend...
erader is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-16-2011 , 15:15   Re: [REQ] After round starts join slay
Reply With Quote #4

Try this:

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

// how many seconds after round start are players allowed to spawn 
#define ALLOWED_SPAWN_SECONDS 1 

new Float:g_fRoundStart
new 
boolg_bFreezeTime;

public 
plugin_init( ) { 
    
register_plugin"Anti-LateSpawn""0.0.1""Exolent" ); 
    
    
register_event"HLTV""EventHLTV""a""1=0""2=0" );
    
register_logevent"EventRoundStart"2"1=Round_Start" ); 
     
    
RegisterHamHam_Spawn"player""FwdPlayerSpawnPost"); 


public 
EventHLTV( ) {
    
g_bFreezeTime true;
}

public 
EventRoundStart( ) { 
    
g_bFreezeTime false;
    
    
g_fRoundStart get_gametime( ); 


public 
FwdPlayerSpawnPostiPlayer ) { 
    if( !
g_bFreezeTime
    
&& is_user_aliveiPlayer 
    && 
get_gametime( ) > ( g_fRoundStart ALLOWED_SPAWN_SECONDS ) ) { 
        
user_silentkilliPlayer ); 
         
        
client_printiPlayerprint_chat"You spawned too late into the round." ); 
    } 

__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
erader
Senior Member
Join Date: Dec 2010
Old 06-16-2011 , 15:56   Re: [REQ] After round starts join slay
Reply With Quote #5

Quote:
Originally Posted by drekes View Post
Try this:

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

// how many seconds after round start are players allowed to spawn 
#define ALLOWED_SPAWN_SECONDS 1 

new Float:g_fRoundStart
new 
boolg_bFreezeTime;

public 
plugin_init( ) { 
    
register_plugin"Anti-LateSpawn""0.0.1""Exolent" ); 
    
    
register_event"HLTV""EventHLTV""a""1=0""2=0" );
    
register_logevent"EventRoundStart"2"1=Round_Start" ); 
     
    
RegisterHamHam_Spawn"player""FwdPlayerSpawnPost"); 


public 
EventHLTV( ) {
    
g_bFreezeTime true;
}

public 
EventRoundStart( ) { 
    
g_bFreezeTime false;
    
    
g_fRoundStart get_gametime( ); 


public 
FwdPlayerSpawnPostiPlayer ) { 
    if( !
g_bFreezeTime
    
&& is_user_aliveiPlayer 
    && 
get_gametime( ) > ( g_fRoundStart ALLOWED_SPAWN_SECONDS ) ) { 
        
user_silentkilliPlayer ); 
         
        
client_printiPlayerprint_chat"You spawned too late into the round." ); 
    } 

Same problem.

Ps. I have respawn on the first 30 seconds.
__________________
If you live for something, you're not alone my friend...
erader is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-16-2011 , 16:37   Re: [REQ] After round starts join slay
Reply With Quote #6

Have you edited the define on top of the sma ?
It seemed to work for me & podbots.
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
erader
Senior Member
Join Date: Dec 2010
Old 06-16-2011 , 16:57   Re: [REQ] After round starts join slay
Reply With Quote #7

Quote:
Originally Posted by drekes View Post
Have you edited the define on top of the sma ?
It seemed to work for me & podbots.
No, I've just compiled it.
__________________
If you live for something, you're not alone my friend...
erader is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 06-16-2011 , 18:44   Re: [REQ] After round starts join slay
Reply With Quote #8

This code should allow them to spawn when freezetime is on, and kill them if they spawn after freezetime. That's what you want, right ?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
bibu
Veteran Member
Join Date: Sep 2010
Old 06-17-2011 , 01:09   Re: [REQ] After round starts join slay
Reply With Quote #9

http://forums.alliedmods.net/showthread.php?p=555695
__________________
Selling tons of my own private works.
Accepting paid work for clans and communities.
Don't hesitate to contact me.
bibu is offline
erader
Senior Member
Join Date: Dec 2010
Old 06-18-2011 , 15:29   Re: [REQ] After round starts join slay
Reply With Quote #10

Quote:
Originally Posted by bibu View Post
Thanks but doesn't fix my problem

@ drekes Freezetime is set to 0
__________________
If you live for something, you're not alone my friend...

Last edited by erader; 06-18-2011 at 15:31.
erader 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 01:22.


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