Raised This Month: $ Target: $400
 0% 

TF2 Idle Server Plugin?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
igotfits
Senior Member
Join Date: May 2009
Old 05-31-2013 , 01:20   TF2 Idle Server Plugin?
Reply With Quote #1

is there a plugin that when a red player spawns it cannot move or shoot.
igotfits is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-31-2013 , 03:45   Re: TF2 Idle Server Plugin?
Reply With Quote #2

Not publicly available.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 05-31-2013 , 05:32   Re: TF2 Idle Server Plugin?
Reply With Quote #3

Here you go.

cvar is sm_disableteam. Set to 2 to freeze RED, 3 to freeze BLU, anything else to disable the plugin.
Attached Files
File Type: sp Get Plugin or Get Source (disableteam.sp - 682 views - 1.3 KB)

Last edited by ddhoward; 05-31-2013 at 20:07.
ddhoward is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 05-31-2013 , 06:35   Re: TF2 Idle Server Plugin?
Reply With Quote #4

You use a timer passing client on player spawn, then search and remove all weapons. This is going to cause some errors. There are other plugins, posted in other threads but that do this already. You may want to just use TF2_RemoveAllWeapons.. Inventory application would be a better hook. Or if using tf2items, just return plugin handled and prevent the item from even being generated.

This approach leaves clients in ref pose (looks dumb). It also can cause issues with spawn/view offset (freezing in place).
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Unreal1
AlliedModders Donor
Join Date: Dec 2010
Old 05-31-2013 , 09:01   Re: TF2 Idle Server Plugin?
Reply With Quote #5

I can make that plugin, just PM me.
Unreal1 is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 05-31-2013 , 20:01   Re: TF2 Idle Server Plugin?
Reply With Quote #6

Quote:
Originally Posted by friagram View Post
You use a timer passing client on player spawn, then search and remove all weapons. This is going to cause some errors.
How so? The timer is so short; not many people will be disconnecting in the 1/10th of a second that the timer is in effect. In any case, I've added some redundant checks to the timed event.

Removing all the weapons immediately upon spawn/application doesn't seem to sucessfully grab all weapons. Just tried it without a timer; sappers are not successfully removed. The delay is apparently necessary if you want to remove sappers and the engineer's build tool.

Quote:
There are other plugins, posted in other threads but that do this already.
??? I thought you said that the plugins weren't publicly available?

Quote:
You may want to just use TF2_RemoveAllWeapons
Forgot all about that, thanks. Changing the attached plugin now.

Quote:
This approach leaves clients in ref pose (looks dumb). It also can cause issues with spawn/view offset (freezing in place).
None of that matters, as the players are idle/AFK.

Last edited by ddhoward; 05-31-2013 at 20:18.
ddhoward is offline
igotfits
Senior Member
Join Date: May 2009
Old 05-31-2013 , 21:10   Re: TF2 Idle Server Plugin?
Reply With Quote #7

Quote:
Originally Posted by ddhoward View Post
Here you go.

cvar is sm_disableteam. Set to 2 to freeze RED, 3 to freeze BLU, anything else to disable the plugin.
hey ddhoward ty verymuch, ill try it out. greatly appreciated here man.

Last edited by igotfits; 05-31-2013 at 21:26.
igotfits is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 06-01-2013 , 16:19   Re: TF2 Idle Server Plugin?
Reply With Quote #8

There's no reason to skip client/validation checks. Just because sourcemod (generally) holds your hand and will stack trace if something bad does happen and bail you out, does not mean that it ever should.

It takes virtually no time to pass timers with userids, or validate clients
I also learned this the hard way.

Sorry I was a bit tired... I was referring to the strange/unlocks plugins which you could have modified.

PHP Code:
public Action:DoFreeze(Handle:timerany:client) {
    if (
IsClientConnected(client)) {
        if (
IsClientInGame(client)) {
            if (
IsPlayerAlive(client)) {
                if (
GetClientTeam(client) == GetConVarInt(hcvar_team)) {
                    
SetEntityMoveType(clientMOVETYPE_NONE);
                    
TF2_RemoveAllWeapons(client);
                }
            }
        }
    }

??

This is a good one: #4 and on, passing clients safely
https://forums.alliedmods.net/showth...ientFromSerial
If you use userids, all you have to do is check if(client) to see if they are still ingame
also, isclientingame implies isclientconnected.
Only use isclientconnected, if you want to see if they are connected.. use isclientingame if you want to see if their entity exists in the game.

allllllllllllllllllllllso since you are geting a userid from an event... you already have it, so just pass that to your timer.

I'm not 100% sure on this, but I think I read somewhere that timers should return values for clarity =/
Either plugin_continue or plugin_stop I may very well be wrong on this one. I see people returning plugin_handled, and I dunno why they dot hat =|
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.

Last edited by friagram; 06-01-2013 at 16:23.
friagram is offline
igotfits
Senior Member
Join Date: May 2009
Old 06-02-2013 , 18:34   Re: TF2 Idle Server Plugin?
Reply With Quote #9

ddhoward, i have the plugin running great!, but i noticed players do not spawn with weapons. so when they die nothing drops. that can be a problem because when the other team is killing them in hopes of them dropping weapons for ammo nothing drops. is there an alteration that can be made so they spawn with weapons but cant shoot?
igotfits is offline
igotfits
Senior Member
Join Date: May 2009
Old 09-26-2013 , 20:28   Re: TF2 Idle Server Plugin?
Reply With Quote #10

Hey fellas me again, can this plugin be modded to allow the team to move but disable weapons?
igotfits 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 02:29.


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