Raised This Month: $51 Target: $400
 12% 

[ASW] Self and Friendlyfire disabler


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Plugin ID:
2509
Plugin Version:
1.1
Plugin Category:
Server Management
Plugin Game:
Alien Swarm
Plugin Dependencies:
Servers with this Plugin:
 
Plugin Description:
Disables friendlyfire
Old 08-21-2011 , 06:05   [ASW] Self and Friendlyfire disabler
Reply With Quote #1

Alien Swarm

Description:
Allow the server to disable friendlyfire
Obeys exists console variable mp_friendlyfire

Requirements:
SDKHooks 1.3 or higher
SwarmTools - Alien Swarm Function Lib for Plugin Devs

Console Variables:
asw_ffdisabler_version - The version of the plugin
mp_friendlyfire - Friendlyfire manager

Changelog:
Added hooks on late load
Changed Cvar version to asw_ffdisabler_version
Moved everything from OnConfigsExecuted to OnPluginStart
Attached Files
File Type: smx friendlyfire_disabler.smx (3.3 KB, 349 views)
File Type: sp Get Plugin or Get Source (friendlyfire_disabler.sp - 392 views - 2.1 KB)

Last edited by psychonic; 11-03-2011 at 22:42. Reason: changed game to Alien Swarm
Despirator is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 08-21-2011 , 17:33   Re: [ASW] Self and Friendlyfire disabler
Reply With Quote #2

Move everything you currently have in OnConfigsExecuted to OnPluginStart (You can ditch the global handle). You should also check if GetEdictClassname returns true or false. If false is returned, classname still contains garbage.

Since this is specific to asw, you should probably change the version to something that reflects that.

PM me when the first block is addressed.
KyleS is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 08-22-2011 , 04:04   Re: [ASW] Self and Friendlyfire disabler
Reply With Quote #3

I took this part of code from psychonic's SwarmTools and i don't thing it is incorrect because of comparing strings for truly classname even when it contains garbage
PHP Code:
bool:IsValidMarine(marine)
{
    if (!
IsValidEdict(marine))
        return 
false;
    
    
decl String:classname[64];
    
GetEdictClassname(marineclassnamesizeof(classname));
    
    return !(
strcmp(classname"asw_marine"));

I used the same things in OnConfigsExecuted in any of my plugins, and they are aprroved, but as you insisted on it, I've moved them to OnPluginStart
Despirator is offline
paul92
Senior Member
Join Date: Sep 2010
Old 10-15-2012 , 15:22   Re: [ASW] Self and Friendlyfire disabler
Reply With Quote #4

Hi, how should this work? I still can damage my friends and bots either with convar set on 1 either on convar set on 0...
What am i doing wrong?

EDIT: I can't damage online players, but STILL can damage bots... Any idea why it would happen?

Last edited by paul92; 10-15-2012 at 17:28.
paul92 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 08:25.


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