AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   connection command tf2 (https://forums.alliedmods.net/showthread.php?t=67240)

Freelancer 02-19-2008 07:27

connection command tf2
 
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.

naris 02-19-2008 10:37

Re: connection command tf2
 
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/

Freelancer 02-19-2008 11:52

Re: connection command tf2
 
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

BAILOPAN 02-19-2008 12:11

Re: connection command tf2
 
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

Freelancer 02-19-2008 13:39

Re: connection command tf2
 
arh only see spec selection as far as team choice goes , does that mean no auto join feture for tf2 then :(

BAILOPAN 02-19-2008 18:39

Re: connection command tf2
 
Probably not, unless you can convince Valve to add a command for you. Does ChangeClientTeam() work in TF2?

Freelancer 02-19-2008 20:04

Re: connection command tf2
 
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?

bl4nk 02-19-2008 23:34

Re: connection command tf2
 
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.

Scuzzy 02-20-2008 02:27

Re: connection command tf2
 
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

Freelancer 02-20-2008 05:24

Re: connection command tf2
 
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 :P

Quote:

Originally Posted by bl4nk (Post 587325)
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 :P 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 :P


All times are GMT -4. The time now is 23:13.

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