Raised This Month: $ Target: $400
 0% 

client_putinserver, client_connect, client_disconnect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-22-2005 , 05:50   client_putinserver, client_connect, client_disconnect
Reply With Quote #1

i have 4 questions!

1. when is client_putinserver called, when the player has choosen team and spawned or when the player comes to the motd screen?

2. is client_connect called when a player has connected or when the player starting to connect?

3. is there any way to exec an command (client_cmd) when a player disconnects? (it is not possibe to onley set it in client_disconnect)

4. is it possible to make the flashlight stronger for one person (or all) or totally make an new flashlight function
__________________
Sig(h)!
Obbin is offline
DahVid
Senior Member
Join Date: Jun 2005
Old 08-22-2005 , 06:14   Re: client_putinserver, client_connect, client_disconnect
Reply With Quote #2

Quote:
Originally Posted by obbin
i have 4 questions!

1. when is client_putinserver called, when the player has choosen team and spawned or when the player comes to the motd screen?

2. is client_connect called when a player has connected or when the player starting to connect?

3. is there any way to exec an command (client_cmd) when a player disconnects? (it is not possibe to onley set it in client_disconnect)

4. is it possible to make the flashlight stronger for one person (or all) or totally make an new flashlight function

1. MOTD,
Code:
public plugin_init()
{
    register_logevent( "Event_RoundStart", 2, "0=World triggered", "1=Round_Start" );
    register_logevent( "Event_RoundEnd",   2, "0=World triggered", "1=Round_End" );
}
is what your looking for.

2. When he is connected, meaning when the bars have moved up like 4 places into verifying resources or so.

3. Hmm, I don't think a client-command would work, not positive.. Sorry
Maybe if you made a set_task like this... (Not sure)
Code:
public client_disconnect()
{
set_task(1.0,"client_execmd")
}
public client_execmd(id)
{
client_cmd(id,"quit")
}
4. Yes, you'd probably remake the flashlight.. using a message or whatnot.
DahVid is offline
JuXas
Member
Join Date: Jul 2005
Location: Panavezys, Lithuania
Old 08-22-2005 , 14:04   Re: client_putinserver, client_connect, client_disconnect
Reply With Quote #3

Quote:
Originally Posted by DahVid
1. MOTD,
Code:
public plugin_init()
{
    register_logevent( "Event_RoundStart", 2, "0=World triggered", "1=Round_Start" );
    register_logevent( "Event_RoundEnd",   2, "0=World triggered", "1=Round_End" );
}
is what your looking for.
then how to get player's id?
__________________
-- Nothing Here --
JuXas is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 08-22-2005 , 14:29   Re: client_putinserver, client_connect, client_disconnect
Reply With Quote #4

Quote:
Originally Posted by DahVid
Quote:
Originally Posted by obbin
1. when is client_putinserver called, when the player has choosen team and spawned or when the player comes to the motd screen?
1. MOTD,
Code:
public plugin_init()
{
    register_logevent( "Event_RoundStart", 2, "0=World triggered", "1=Round_Start" );
    register_logevent( "Event_RoundEnd",   2, "0=World triggered", "1=Round_End" );
}
is what your looking for.
DahVid, unless you know something that obbin didn't specify in this thread, the code you gave doesn't make sense in this context. The code you gave tells when a round has started or ended. It has nothing to do with client_putinserver().

Quote:
Originally Posted by JuXas
then how to get player's id?
You don't. Capturing those two events that DahVid provided just tells you that the round has started or ended which is non-player specific. If you want to know when each individual player spawns, you can hook into "ResetHUD". You can search the forums for many examples if you'd like more details.
Brad is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-22-2005 , 16:25  
Reply With Quote #5

then i have one moore question!

how to choose team for the player and jump over the "choose team" screen?
__________________
Sig(h)!
Obbin is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 08-22-2005 , 16:38  
Reply With Quote #6

I'm pretty sure the following will do what you want: http://www.amxmodx.org/funcwiki.php?go=func&id=200
Brad is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 08-23-2005 , 02:32  
Reply With Quote #7

but how to "jump over" the choose team part (optionally tell that terrorists team are full)

allso i want to know how to use messages (how to make my own flashlight)
__________________
Sig(h)!
Obbin is offline
JuXas
Member
Join Date: Jul 2005
Location: Panavezys, Lithuania
Old 08-24-2005 , 07:59  
Reply With Quote #8

If you want to make your own flashlight, just get origin where player is looking at and then use message to create a light there.

Message look like this:
Code:
public function (id) { new origin[3] get_user_origin ( id , origin , 3 ) // end position from eyes message_begin ( MSG_BRODADCAST , SVC_TEMPENTITY) write_byte ( 27 )  // TE_DLIGHT write_coord ( origin[0] ) // coord, coord, coord (pos) write_coord ( origin[1] ) write_coord ( origin[2] ) write_byte ( 1 ) // byte (radius in 10's) write_byte ( 255 )// R byte byte byte (color) write_byte ( 255 )// G write_byte ( 255 )// B write_byte ( 192 )// byte (brightness) write_byte ( 1 )// byte (life in 10's) write_byte ( 1 )// byte (decay rate in 10's) message_end() }

and set_task to this command
__________________
-- Nothing Here --
JuXas 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 14:21.


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