AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Player is selecting a class (https://forums.alliedmods.net/showthread.php?t=141299)

Schwabba 10-22-2010 05:45

Player is selecting a class
 
Got a better question:

How i can make that a player is automatically joined CT and a class?

dias 10-22-2010 06:30

Re: Player is selecting a class
 
Try this:

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

}

public 
client_putinserver(id)
{
    
cs_set_user_team(idCS_TEAM_CT)



Schwabba 10-22-2010 06:40

Re: Player is selecting a class
 
Nope, it makes the server crash, but..

PHP Code:

    register_clcmd("chooseteam""ClientChange"

PHP Code:

public ClientChange (id)
{
    
cs_set_user_team(idCS_TEAM_CT)
    return 
PLUGIN_HANDLED;


doesn't work too, because you get teleported to the cameras with it.


EDIT:

I found it out:

PHP Code:

public plugin_init()
{
    
server_cmd"humans_join_team CT" );
    
register_message(get_user_msgid("ShowMenu"), "autojoin")
    
register_message(get_user_msgid("VGUIMenu"), "autojoin")
}

public 
autojoin(msgiddestid)
{
    
client_cmd(id"joinclass"2)
    return 
PLUGIN_HANDLED




All times are GMT -4. The time now is 10:15.

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