Raised This Month: $ Target: $400
 0% 

Late Joined


Post New Thread Reply   
 
Thread Tools Display Modes
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-15-2009 , 21:20   Re: Late Joined
Reply With Quote #11

Quote:
Originally Posted by vitorrd View Post
Small correction to Exolent's code: at function EventNewRound, player indexes start at 1, not at 0 as specified in his loop.
That changes nothing in the functionality.
I'm clearing the array. I didn't care about the player indexes.
I edited my code to fit the player index range.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-18-2009 , 05:16   Re: Late Joined
Reply With Quote #12

I cannot view second page.
Mr.Noobie is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-18-2009 , 09:34   Re: Late Joined
Reply With Quote #13

Quote:
Originally Posted by Exolent[jNr] View Post
Code:
#include < amxmodx ></p><p>#include < amxmisc ></p><p>#include < hamsandwich ></p><p>&nbsp;</p><p>new bool:g_bSpawned[ 33 ];</p><p>new Trie:g_tLateJoiners;</p><p>new g_iMaxPlayers;</p><p>&nbsp;</p><p>public plugin_init( ) {</p><p> register_plugin( "Spawn After Late Join", "0.1", "Exolent" );</p><p>&nbsp;</p><p> register_clcmd( "say /latejoin", "CmdLateJoin" );</p><p>&nbsp;</p><p> register_event( "HLTV", "EventNewRound", "a", "1=0", "2=0" );</p><p> RegisterHam( Ham_Spawn, "player", "FwdPlayerSpawn", 1 );</p><p>&nbsp;</p><p> g_tLateJoiners = TrieCreate( );</p><p>&nbsp;</p><p> g_iMaxPlayers = get_maxplayers( );</p><p>}</p><p>&nbsp;</p><p>public plugin_end( ) {</p><p> TrieDestroy( g_tLateJoiners );</p><p>}</p><p>&nbsp;</p><p>public client_disconnect( client ) {</p><p> g_bSpawned[ client ] = false;</p><p>}</p><p>&nbsp;</p><p>public CmdLateJoin( client ) {</p><p> if( is_user_alive( client ) ) {</p><p> client_print( client, print_chat, "[LateJoin] You are already alive!" );</p><p> }</p><p> else if( g_bSpawned[ client ] ) {</p><p> client_print( client, print_chat, "[LateJoin] You already spawned in this round!" );</p><p> } else {</p><p> static szAuthid[ 35 ];</p><p> get_user_authid( client, szAuthid, 34 );</p><p>&nbsp;</p><p> if( TrieKeyExists( g_tLateJoiners, szAuthid ) ) {</p><p> client_print( client, print_chat, "[LateJoin] You cannot reconnect to use /latejoin again!" );</p><p> } else {</p><p> static szName[ 32 ];</p><p> get_user_name( client, szName, 31 );</p><p>&nbsp;</p><p> client_print( 0, print_chat, "[LateJoin] %s used /latejoin and is now alive!", szName );</p><p>&nbsp;</p><p> TrieSetCell( g_tLateJoiners, szAuthid, 1 );</p><p>&nbsp;</p><p> ExecuteHamB( Ham_CS_RoundRespawn, client );</p><p> }</p><p> }</p><p>&nbsp;</p><p> return PLUGIN_HANDLED;</p><p>}</p><p>&nbsp;</p><p>public EventNewRound( ) {</p><p> for( new i = 1; i <= g_iMaxPlayers; i++ ) {</p><p> g_bSpawned[ i ] = false;</p><p> }</p><p>}</p><p>&nbsp;</p><p>public FwdPlayerSpawn( client ) {</p><p> if( is_user_alive( client ) ) {</p><p> g_bSpawned[ client ] = true;</p><p> }</p><p>}
Sorry for the double posting.

PHP Code:
register_event"HLTV""event_round_start""a""1=0""2=0" 
I already have this "event_round_start"

I try
PHP Code:
register_event"HLTV""event_round_start""EventNewRound""a""1=0""2=0" 
It work but some plugin didn't work if i put this
PHP Code:
register_event"HLTV""event_round_start""EventNewRound""a""1=0""2=0" 
Mr.Noobie is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-18-2009 , 09:35   Re: Late Joined
Reply With Quote #14

It should normally work.
Only if you have made mistakes in the EventNewRound function...
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
alan_el_more
Veteran Member
Join Date: Jul 2008
Location: amxmodx-es.com
Old 09-18-2009 , 09:40   Re: Late Joined
Reply With Quote #15

For zp change this:

PHP Code:
ExecuteHamBHam_CS_RoundRespawnclient 
for this:

PHP Code:
zp_respawn_user(clientZP_TEAM_HUMAN
__________________
alan_el_more is offline
Mr.Noobie
BANNED
Join Date: Apr 2009
Old 09-18-2009 , 11:00   Re: Late Joined
Reply With Quote #16

Quote:
Originally Posted by ot_207 View Post
It should normally work.
Only if you have made mistakes in the EventNewRound function...
I mean some plugin didn't work in there, not the respawn.

PHP Code:
register_event"HLTV""event_round_start""EventNewRound""a""1=0""2=0" 
PHP Code:
public event_round_start( )
{
 new 
t
 t 
random_num0sizeof round_start-)
 
//client_cmd( 0, "spk %s", round_start[ t ] )
 
emit_sound0CHAN_AUTOround_start], VOL_NORMATTN_NONE0PITCH_NORM )
 
 
set_task4.0"zombie_countdown" )
 
Time 10
 Countdown 
9
 remove_task
BLAST_TASK )
}

public 
EventNewRound( )
{
    for( new 
1<= MaxPlayersi++ )
    {
        
g_bSpawned] = false;
    }
}
public 
client_disconnect)
{
        
g_bSpawned] = false

Mr.Noobie is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-18-2009 , 11:59   Re: Late Joined
Reply With Quote #17

Quote:
Originally Posted by Mr.Noobie View Post
PHP Code:
register_event"HLTV""event_round_start""EventNewRound""a""1=0""2=0" 
Do you even know what you're doing?

PHP Code:
register_event"HLTV""event_round_start""a""1=0""2=0" 
PHP Code:
public event_round_start( )
{
 new 
t
 t 
random_num0sizeof round_start-)
 
//client_cmd( 0, "spk %s", round_start[ t ] )
 
emit_sound0CHAN_AUTOround_start], VOL_NORMATTN_NONE0PITCH_NORM )
 
 
set_task4.0"zombie_countdown" )
 
Time 10
 Countdown 
9
 remove_task
BLAST_TASK )
 for( new 
1<= MaxPlayersi++ )
 {
  
g_bSpawned] = false;
 }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 08:18.


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