AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   client_putinserver, client_connect, client_disconnect (https://forums.alliedmods.net/showthread.php?t=16896)

Obbin 08-22-2005 05:50

client_putinserver, client_connect, client_disconnect
 
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

DahVid 08-22-2005 06:14

Re: client_putinserver, client_connect, client_disconnect
 
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.

JuXas 08-22-2005 14:04

Re: client_putinserver, client_connect, client_disconnect
 
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?

Brad 08-22-2005 14:29

Re: client_putinserver, client_connect, client_disconnect
 
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.

Obbin 08-22-2005 16:25

then i have one moore question!

how to choose team for the player and jump over the "choose team" screen?

Brad 08-22-2005 16:38

I'm pretty sure the following will do what you want: http://www.amxmodx.org/funcwiki.php?go=func&id=200

Obbin 08-23-2005 02:32

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)

JuXas 08-24-2005 07:59

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


All times are GMT -4. The time now is 14:21.

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