Raised This Month: $102 Target: $400
 25% 

[L4D & L4D2] Switch Players


Post New Thread Reply   
 
Thread Tools Display Modes
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 11-23-2009 , 17:04   Re: [L4D] Switch Players
Reply With Quote #121

Just so you know, this here works well enough as temporary fix

PHP Code:
    // If target is survivors .... we need to do a little trick ....
    
if (team == 2)
    {
        
// first we switch to spectators ..
        
ChangeClientTeam(target1); 
        
        
// Search for an empty bot
        
new bot 1;
        while !(
IsClientConnected(bot) && IsFakeClient(bot) && (GetClientTeam(bot) == 2)) do bot++;
            
        
// force player to spec humans
        //SDKCall(fSHS, bot, target); 
        
        // force player to take over bot
        //SDKCall(fTOB, target, true);
        
        
FakeClientCommand(target"jointeam 2");
    } 
AtomicStryker is offline
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-23-2009 , 18:10   Re: [L4D] Switch Players
Reply With Quote #122

Quote:
Originally Posted by AtomicStryker View Post
Just so you know, this here works well
could you compile that for us please?
GanjaStar is offline
Anduril
Member
Join Date: Jul 2009
Old 11-23-2009 , 21:03   Re: [L4D] Switch Players
Reply With Quote #123

Here's the file.

Just followed the comments on the new, found teh same comments on the old. They're kinda unique.

Pretty sure I did it right. I'll toss the source up so you can look at it. But in "team" games (vs/scavenge), you still cant switch people. Unless theres something else that needs to be done to override the team vs block on switching players.
Attached Files
File Type: smx L4DSwitchPlayers.smx (7.5 KB, 89 views)
File Type: sp Get Plugin or Get Source (L4DSwitchPlayers.sp - 255 views - 12.1 KB)

Last edited by Anduril; 11-23-2009 at 22:29. Reason: added source, new comment
Anduril is offline
GanjaStar
Senior Member
Join Date: Jun 2009
Old 11-23-2009 , 23:24   Re: [L4D] Switch Players
Reply With Quote #124

Quote:
Originally Posted by Anduril View Post
Here's the file.

Ju But in "team" games (vs/scavenge), you still cant switch people. Unless theres something else that needs to be done to override the team vs block on switching players.

thx anduril. I hope they get it working in versus soon. i only play versus
GanjaStar is offline
Anduril
Member
Join Date: Jul 2009
Old 11-23-2009 , 23:28   Re: [L4D] Switch Players
Reply With Quote #125

I'm pretty sure its just team vs cause valve locked the switch team option (i.e. when you press m or w/e key you bound to it, it says you're not allowed to switch teams) and thats different than simple using the max number of switches. IDK. Hope someone can get a workaround. I'll test this on normal vs/scav games tonight/tomorrow.
Anduril is offline
djromero
Senior Member
Join Date: Dec 2008
Location: Maracaibo, Venezuela
Old 11-24-2009 , 14:44   Re: [L4D] Switch Players
Reply With Quote #126

Quote:
Originally Posted by Anduril View Post
Here's the file.

Just followed the comments on the new, found teh same comments on the old. They're kinda unique.

Pretty sure I did it right. I'll toss the source up so you can look at it. But in "team" games (vs/scavenge), you still cant switch people. Unless theres something else that needs to be done to override the team vs block on switching players.
That's why the plugin uses the SDK call instead of using the client commands, because of Valve's restrictions.

To make it work we'll need the signature for that function.
__________________
David Romero


djromero is offline
Cuthbert
Senior Member
Join Date: Nov 2009
Old 11-24-2009 , 19:15   Re: [L4D] Switch Players
Reply With Quote #127

Could someone please provide their .cfg file for this? I'm having a problem that .cfg files do not compile automatically when I put the .smx file in my server's sourcemod plugins folder.
Cuthbert is offline
Anduril
Member
Join Date: Jul 2009
Old 11-24-2009 , 23:40   Re: [L4D] Switch Players
Reply With Quote #128

Quote:
Originally Posted by Cuthbert View Post
Could someone please provide their .cfg file for this? I'm having a problem that .cfg files do not compile automatically when I put the .smx file in my server's sourcemod plugins folder.
Pretty sure there is no .cfg made for this since theres only one cvar which I believe most/all people want on (as it is default).
Anduril is offline
AtomicStryker
Veteran Member
Join Date: Apr 2009
Location: Teutonia!!
Old 11-26-2009 , 07:28   Re: [L4D] Switch Players
Reply With Quote #129

Yay, it is done xD

https://forums.alliedmods.net/showpo...9&postcount=23
AtomicStryker is offline
djromero
Senior Member
Join Date: Dec 2008
Location: Maracaibo, Venezuela
Old 11-26-2009 , 09:47   Re: [L4D] Switch Players
Reply With Quote #130

Thank you very much AtomicStryker.

I just updated plugin (for version cvar & credits) and the signatures files.

I haven't tested it yet (i'm at the office right now) but if someone can do the honors and post results .... i'll be gratefull:
Attached Files
File Type: sp Get Plugin or Get Source (L4DSwitchPlayers.sp - 224 views - 12.0 KB)
File Type: txt l4dswitchplayers.txt (1.1 KB, 106 views)
__________________
David Romero


djromero 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 05:43.


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