Raised This Month: $ Target: $400
 0% 

[deleted]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-07-2007 , 08:52   Re: Hooking latejoin spawn
Reply With Quote #2

Don't know if it's hookable, i would try to kill players after a setable time.
Try something like this, players shouldn't leave if they spawn 3 seconds after the round has begun.

Code:
#include <amxmodx> #define MAX_PLAYERS 32 new bool:g_RestartAttempt[MAX_PLAYERS+1] new Float:g_roundstart_time new bool:g_freezetime = true new p_spawndelay public plugin_init() {     register_plugin("Too Late to Spawn","0.1","connor")         register_event("HLTV", "eNewRound", "a", "1=0", "2=0")     register_logevent("eRoundStart", 2, "1=Round_Start")     register_event("TextMsg", "eRestartAttempt", "a", "2=#Game_will_restart_in")     register_event("ResetHUD", "eResetHUD", "be")     p_spawndelay = register_cvar("amx_max_spawndelay","3.0")     register_clcmd("clcmd_fullupdate", "fullupdateCmd") } public fullupdateCmd() {     return PLUGIN_HANDLED_MAIN } public eRestartAttempt() {     new players[32], num     get_players(players, num, "a")     for (new i; i < num; ++i)         g_RestartAttempt[players[i]] = true } public eResetHUD(id) {     if (g_RestartAttempt[id]) {         g_RestartAttempt[id] = false         return     }     event_player_spawn(id) }   public event_player_spawn(id) {     new Float:delay = get_pcvar_float(p_spawndelay)     if(!delay)         return     if(g_freezetime)         return     if(get_gametime() - g_roundstart_time > delay)         user_silentkill(id) } public eNewRound() {     g_freezetime = true } public eRoundStart() {     g_freezetime = false     g_roundstart_time = get_gametime() }

Last edited by ConnorMcLeod; 10-21-2007 at 07:07.
ConnorMcLeod is offline
 



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 16:11.


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