Raised This Month: $404 Target: $400
 101% 

[TF2] Friendly Mode (v. 16.0112)


Post New Thread Reply   
 
Thread Tools Display Modes
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-16-2013 , 14:51   Re: [TF2] Friendly Mode
Reply With Quote #41

Uploading new version 13.0416 (1048). It is attached to this post, and will soon replace the version in the first post in this thread. Changes are:
  • Complete rewrite of the code that executes each time the command is run, and what happens on spawn. Future simple updates should be less of a headache.

  • Combined cvars sm_friendly_wait_hostile and sm_friendly_punish_hostile into sm_friendly_action_h, please see the first post for details on usage.

  • Combined cvars sm_friendly_wait_friendly and sm_friendly_punish_friendly into sm_friendly_action_f, please see the first post for details on usage.

  • sm_friendly_buddha is now sm_friendly_invuln, and can now enable full godmode on Friendly players.

  • Dead players can now specify whether they want to toggle modes on respawn. (Players who died while Friendly will still always respawn as non-Friendly, if sm_friendly_remember = 0.)

  • Rewrote and re-enabled debug command

  • sm_friendly no longer requires the ban flag by default: the command is now public by default. You can change this in your Overrides.

Please let me know if you run into any issues.
Attached Files
File Type: smx friendly.smx (7.0 KB, 41 views)
File Type: sp Get Plugin or Get Source (friendly.sp - 187 views - 10.7 KB)

Last edited by ddhoward; 04-16-2013 at 15:42.
ddhoward is offline
Wazman
SourceMod Donor
Join Date: Oct 2012
Location: Michigan
Old 04-16-2013 , 16:56   Re: [TF2] Friendly Mode
Reply With Quote #42

Yooo, you messed up a little, but don't worry, I fixed it.
Quote:
L 04/16/2013 - 14:50:49: [SM] Native "GetClientWeapon" reported: Client index 685 is invalid
L 04/16/2013 - 14:50:49: [SM] Displaying call stack trace for plugin "friendly.smx":
L 04/16/2013 - 14:50:49: [SM] [0] Line 261, friendly.sp::OnTakeDamage()
I deleted the lines 260-261, they are never used. So They Caused this getclientweapon error.
Quote:
decl String:weapon[32];
GetClientWeapon(attacker, weapon, sizeof(weapon));
I didn't tamper with anything else, same cvars, same commands. Mod is now 100% Safe to use. Have Fun kids ;D

Credit To Impact123 For Teaching me how to fix the error https://forums.alliedmods.net/showth...74#post1933974
Attached Files
File Type: smx friendlyv2.smx (7.7 KB, 41 views)
File Type: sp Get Plugin or Get Source (friendlyv2.sp - 186 views - 10.7 KB)
__________________
My Mods
Add me on steam? ...Also, My Community V


Last edited by Wazman; 04-16-2013 at 19:04.
Wazman is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-16-2013 , 19:11   Re: [TF2] Friendly Mode
Reply With Quote #43

LOL, it didn't even occur to me to check if the line causing the error upon compilation even DID anything.

Uploading new version 13.0416 (1522). It is attached to this post, and will soon replace the version in the first post in this thread. Changes are:
  • Fixed compilation warning and more error log spam, big thanks to everyone here.

  • Added value 3 to sm_friendly_invuln. (Rocket/Sticky Jumping require this cvar to be 1 or 2, will not work with 0 or 3.)

Please let me know if you run into any issues.
Attached Files
File Type: smx friendly.smx (6.9 KB, 42 views)
File Type: sp Get Plugin or Get Source (friendly.sp - 182 views - 10.9 KB)

Last edited by ddhoward; 04-16-2013 at 20:29.
ddhoward is offline
Wazman
SourceMod Donor
Join Date: Oct 2012
Location: Michigan
Old 04-16-2013 , 19:16   Re: [TF2] Friendly Mode
Reply With Quote #44

To be honest, I think there are no more errors, all that's left to do with the mod is upgrade it when you have any ideas lol.

VICTORY DANCE!!!

__________________
My Mods
Add me on steam? ...Also, My Community V


Last edited by Wazman; 04-16-2013 at 19:17.
Wazman is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-17-2013 , 02:18   Re: [TF2] Friendly Mode
Reply With Quote #45

Uploading new version 13.0417 (0000). It is attached to this post, and will soon replace the version in the first post in this thread. Changes are:
  • Added cvar sm_friendly_noblock with default value of 1. When enabled, friendly players will be unable to block the paths of non-friendly players.

    This solution will do for the time being; my main concern was stopping Friendly players from blocking the paths of players who are engaging in PvP. Some things can still be blocked by Friendly players, such as hitscan bullets and certain projectiles like Mad Milk, although this is not a big issue to me at the moment. Hoping to solve this soon though.

    This function works simply with the following code:
    Code:
    GiveCollision(const client) {
    	SetEntProp(client, Prop_Send, "m_CollisionGroup", 5);
    }
    
    RemoveCollision(const client) {
    	SetEntProp(client, Prop_Send, "m_CollisionGroup", 2);
    }
    If anyone has any technical reason why I shouldn't be using this solution, please let me know. It seems to be working fine, with Friendly players being unable to hinder the motions of Hostiles. Hostiles are able to block Friendlies, but I'm not too concerned about this.

  • Added cvar sm_friendly_alpha with default value of 128. When set to a value between and including 0 and 255, friendly users are set to that alpha value. Players will be more see-through the closer you are to 0, and more "solid" the closer you get to 255. Setting this to -1 completely disables the function.

    This solution is temporary; I hope to allow server admins to optionally replace alpha changing with a particle effect to denote friendly players.

  • CVars other than sm_friendly_version are no longer public.

Both of these solutions were realized thanks to code from FlaminSarge's Ghost Mode plugin. Big thanks to him!!!

Please let me know if you run into any issues.
Attached Files
File Type: smx friendly.smx (8.9 KB, 38 views)
File Type: sp Get Plugin or Get Source (friendly.sp - 194 views - 12.9 KB)

Last edited by ddhoward; 04-17-2013 at 02:59.
ddhoward is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-17-2013 , 02:19   Re: [TF2] Friendly Mode
Reply With Quote #46

Then parent an info_particle_system to the player, and send it the start input
__________________
Profile - Steam Group - Plugins - Blog - Donate
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
island55
Senior Member
Join Date: Aug 2010
Location: charleston
Old 04-17-2013 , 10:53   Re: [TF2] Friendly Mode (now with NoBlock and Alpha!)
Reply With Quote #47

can you also make it so friendly players cannot cap control points?

edit: can you also make it so only like 40% or 50% of the servers players can enter friendly mode, this would prevent everyone being friendly and nobody playing. this would be nice with an immunity option as well..

Last edited by island55; 04-17-2013 at 13:18.
island55 is offline
vman315
SourceMod Donor
Join Date: Sep 2012
Location: Behind a keyboard
Old 04-17-2013 , 11:09   Re: [TF2] Friendly Mode (now with NoBlock and Alpha!)
Reply With Quote #48

Dank ya. I will have fun with this.
__________________
Last edited by ; Today at 08:20 AM. Reason: Get rid of s
vman315 is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 04-17-2013 , 17:59   Re: [TF2] Friendly Mode (now with NoBlock and Alpha!)
Reply With Quote #49

Quote:
Originally Posted by island55 View Post
can you also make it so friendly players cannot cap control points?
Could have sworn this was already in my "to do" list. I've put it on the list now, hopefully this won't be a hard addition to the plugin.

Quote:
Originally Posted by island55 View Post
edit: can you also make it so only like 40% or 50% of the servers players can enter friendly mode, this would prevent everyone being friendly and nobody playing.
I don't think I'll be adding this; if a player wants to be friendly, but can't, he'll just stay in spawn and not fight. This plugin really isn't designed for servers where combat is the main attraction, such as actual gameplay servers.

Quote:
Originally Posted by island55 View Post
this would be nice with an immunity option as well..
What do you mean immunity option? You mean letting certain players (admins) be able to attack Friendlies? I'll look into this; sometimes bind mouse3 "sm_slay @aim" isn't as reliable as a shower of hitscan bullets from my minigun.

Last edited by ddhoward; 04-17-2013 at 18:03.
ddhoward is offline
island55
Senior Member
Join Date: Aug 2010
Location: charleston
Old 04-17-2013 , 23:53   Re: [TF2] Friendly Mode (now with NoBlock and Alpha!)
Reply With Quote #50

Quote:
Originally Posted by ddhoward View Post
What do you mean immunity option? You mean letting certain players (admins) be able to attack Friendlies? I'll look into this; sometimes bind mouse3 "sm_slay @aim" isn't as reliable as a shower of hitscan bullets from my minigun.
no no what I meant was adding a feature so only half the players could use the friendly mode at a time and an immunity to this specific option so admins can use friend at all times even if the 50% is surpassed.. but since you wont be adding this feature then don't worry about what I said about the immunity option.

Last edited by island55; 04-17-2013 at 23:54.
island55 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:17.


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