Raised This Month: $12 Target: $400
 3% 

connection command tf2


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Freelancer
Senior Member
Join Date: Jun 2007
Location: Bristol , uk
Old 02-19-2008 , 07:27   connection command tf2
Reply With Quote #1

where would i find a list of commands that sourcespawn can use , im trying to track down the command that tells the server when someone joins the game.

for css "joingame".

but i cant seem to get the tf2 version of it, thanks in advance for a simple enquiry.
Freelancer is offline
naris
AlliedModders Donor
Join Date: Dec 2006
Old 02-19-2008 , 10:37   Re: connection command tf2
Reply With Quote #2

You are not looking for a command. You are looking for an event. There is a difference.

What you want is probably either OnClientConnect() or OnClientPutInServer(), (or perhaps OnClientAuthorized()).

These are not specific to any mod, they work for all hl2 games, including TF2 and CSS.

look here: http://docs.sourcemod.net/api/
naris is offline
Freelancer
Senior Member
Join Date: Jun 2007
Location: Bristol , uk
Old 02-19-2008 , 11:52   Re: connection command tf2
Reply With Quote #3

Code:
FakeClientCommand(client,"joingame");
but tf2 does nt know this command, unknown command joingame.

Ive looked abit though that link and got abit lost , am no way a coder + not even sure what im doing will even work.

I'll keep looking though anyone has a idea of tf2 code would be very helpfull for a pointer or two.

Clan mate pointed im being a bit thick , and sould explain what im trying to do more to clear things up.

Im trying to create a autojoin like CSS has for tf2 , and am working of the css version to try and convert it.

http://forums.alliedmods.net/showthread.php?p=504128
Freelancer is offline
BAILOPAN
Join Date: Jan 2004
Old 02-19-2008 , 12:11   Re: connection command tf2
Reply With Quote #4

To find commands that the server can run on the client, open up your TF2 client, go to the console, and type this:

Code:
findflags server_can_execute
__________________
egg
BAILOPAN is offline
Freelancer
Senior Member
Join Date: Jun 2007
Location: Bristol , uk
Old 02-19-2008 , 13:39   Re: connection command tf2
Reply With Quote #5

arh only see spec selection as far as team choice goes , does that mean no auto join feture for tf2 then
Freelancer is offline
BAILOPAN
Join Date: Jan 2004
Old 02-19-2008 , 18:39   Re: connection command tf2
Reply With Quote #6

Probably not, unless you can convince Valve to add a command for you. Does ChangeClientTeam() work in TF2?
__________________
egg
BAILOPAN is offline
Freelancer
Senior Member
Join Date: Jun 2007
Location: Bristol , uk
Old 02-19-2008 , 20:04   Re: connection command tf2
Reply With Quote #7

Code:
public Action:Timer_1(Handle:timer, any:client)
{
	FakeClientCommand(client,"joingame");
	CreateTimer(1.0, Timer_2, any:client)
}

public Action:Timer_2(Handle:timer, any:client)
{
	ChangeClientTeam(client, 1) // Moves player back to spectator to skip the double-choice-bug
}
problem is tf2 comes back with unkown joingame , any ideas?
Freelancer is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 02-19-2008 , 23:34   Re: connection command tf2
Reply With Quote #8

I don't understand what you're trying to do. You say you're trying to hook when a player connects to the server (which is "OnClientConnect()"), yet you're trying to issue a command on a client. You need to make up your mind with what you want to do.
bl4nk is offline
Scuzzy
Senior Member
Join Date: Oct 2007
Old 02-20-2008 , 02:27   Re: connection command tf2
Reply With Quote #9

This will make you skip choosing a team and a class, but you'll still have to hit the "continue" on the motd and map description screens:

Code:
    
public OnClientPutInServer(client)

{
// Force Red Team Choice. ChangeClientTeam (client, 2); // Force Scout Class Choice. FakeClientCommand(client, "joinclass %s", "scout");
return true;
}
Not a clue why joinclass doesn't seem to show up in "findflags", but it works. We use that command to limit classes by map in a custom plugin to keep "snowbridge" from becoming a sniperfest.

Scuzzy
Scuzzy is offline
Freelancer
Senior Member
Join Date: Jun 2007
Location: Bristol , uk
Old 02-20-2008 , 05:24   Re: connection command tf2
Reply With Quote #10

Thanks guys for helping but its all way over my head now.

tried altering the code but getting error if i remove joinclass and enter 0 , 1 , 2 , 3 maybe ive got to "0" like "joinclass" will give that a go. as i see 0 is auto team. Well it was in CSS just hoping for a tf2 command like the css on guess it not that then

Quote:
Originally Posted by bl4nk View Post
I don't understand what you're trying to do. You say you're trying to hook when a player connects to the server (which is "OnClientConnect()"), yet you're trying to issue a command on a client. You need to make up your mind with what you want to do.
hehe thats makes two of us then dude. Cant put it more clear than trying to make a tf2 ver of the css plugin in the above post but having problems with tf2 simply not understanding "jointeam" from the css code and was hoping for a simple oh in tf2 its this command is this. but nothing is simple in the coding world or ya whould have every tom, dick and harry nicking ya jobs

Last edited by Freelancer; 02-20-2008 at 05:42.
Freelancer is offline
Reply


Thread Tools
Display Modes

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:45.


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