Raised This Month: $ Target: $400
 0% 

CS_SwitchTeam doesn't spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 08-06-2013 , 20:05   CS_SwitchTeam doesn't spawn
Reply With Quote #1

Hi guys, I'm trying to set a team for a new player.
The thing is CS_SwitchTeam on not alive player doesn't seems work properly. This changes player's team to which I want and do not spawn a player; that's exactly what I want. But the weird thing, is that player does not spawn subsequent rounds too! Yes, I can make a variable, and spawn 'em next round automatically, but that doesn't sounds well.
ChangeClientTeam - I love this command too, but it shows to player a choosing model panel; what I don't like to do.

In other words, I want to put a new player in a specific team, not showing them a choosing model panel and spawn them for a limited time if possible(like ChangeClientTeam does(if I'm not mistaken, there's a command to set for how many seconds spawn new players since round starts, but I can't find it)).
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.

Last edited by ShufflexDD; 08-06-2013 at 20:06.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 08-06-2013 , 20:39   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #2

You have to assign them a m_iClass since you're skipping the model (joinclass) panel. Although I can't remember if that's the correct prop; I always FakeClientCommand "joinclass #".
__________________

Last edited by thetwistedpanda; 08-06-2013 at 20:41.
thetwistedpanda is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 08-06-2013 , 20:40   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #3

Use the CS_RespawnPlayer method right after you use the CS_SwitchTeam method and it will respawn them instantly without a character selection menu like you want.
blaacky is offline
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 08-06-2013 , 20:53   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #4

Quote:
Originally Posted by blaacky View Post
Use the CS_RespawnPlayer method right after you use the CS_SwitchTeam method and it will respawn them instantly without a character selection menu like you want.
The thing is that I don't want them to respawn. To be more precise, I want, but within limited time.
Again, I can do a timer, but after some time, I want them not to spawn(like at the end of the round); but in this case, they won't spawn at all.
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 08-06-2013 , 21:03   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #5

Quote:
Originally Posted by thetwistedpanda View Post
You have to assign them a m_iClass since you're skipping the model (joinclass) panel. Although I can't remember if that's the correct prop; I always FakeClientCommand "joinclass #".
I tried to do SetEntProp and after it FakeClientCommand via AddCommandListener(Command_Joingame, "joingame"), but neither of them seems skip joinclass panel:

Code:
ChangeClientTeam(client, CS_TEAM_CT);
SetEntProp(client, Prop_Data, "m_iClass", 8);
// FakeClientCommand(client, "joinclass 8");
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.

Last edited by ShufflexDD; 08-06-2013 at 21:03.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 08-06-2013 , 21:36   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #6

"joingame" ? FakeClientCommand(i, "joinclass %d", GetRandomInt(1, ); works fine for me, and I use the same method. Hook in "jointeam" assign them to a team, then when they're supposed to spawn ensure joinclass # has been fired.
__________________

Last edited by thetwistedpanda; 08-06-2013 at 21:37.
thetwistedpanda is offline
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 08-06-2013 , 21:59   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #7

Probably I misunderstood smx, but I tried:

Code:
public OnPluginStart()
{
	AddCommandListener(Command_Joingame, "joingame");
	HookEvent("player_team", Event_Jointeam, EventHookMode_Pre);
}
public Action:Event_Jointeam(Handle:event, const String:name[], bool:dontBroadcast) // block isn't possible
{
	new client = GetClientOfUserId(GetEventInt(event, "userid"));
	ChangeClientTeam(client, CS_TEAM_CT);
	FakeClientCommand(client, "joinclass %d", GetRandomInt(1, 8));
}
Also tried to put ChangeClientTeam to joingame; and tried EventHookMode_Post, but no luck.
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.

Last edited by ShufflexDD; 08-06-2013 at 21:59.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 08-06-2013 , 22:17   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #8

Blah. Send me code in pm?
__________________

Last edited by thetwistedpanda; 08-06-2013 at 22:17.
thetwistedpanda is offline
ShufflexDD
Senior Member
Join Date: Apr 2011
Location: :noitaɔo˩
Old 08-06-2013 , 22:22   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #9

that's kinda my entire plugin except includes and Plugin:myinfo
__________________

⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈⇈
Check this website and find out how many functions
it has working with game server together.

Last edited by ShufflexDD; 08-06-2013 at 22:23.
ShufflexDD is offline
Send a message via ICQ to ShufflexDD Send a message via Skype™ to ShufflexDD
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 08-06-2013 , 22:25   Re: CS_SwitchTeam doesn't spawn
Reply With Quote #10

Then, hook "jointeam", assign your team there if they're new, set them a boolean flag that they need to have a class set, then when you're ready to spawn them (or at the end of a round), FakeClientCommand them to joinclass 1-4 (T) 5-6 (CT) and they're ready for either CS_RespawnPlayer or automatic spawning next round.
__________________
thetwistedpanda 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 05:46.


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