Raised This Month: $ Target: $400
 0% 

SMLIB 0.11 BETA (over 300 Function Stocks) | updated 15.07.2011


Post New Thread Reply   
 
Thread Tools Display Modes
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-12-2011 , 09:36   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #131

Are you using a prehook ? Because it's working without any problem for me with a posthook, it's dissolving the ragdoll everytime. Even Effect_DissolveEntity() works fine. I can dissolve entities and even players with it.
I tested it in CS:S with a bot and all oildrums standing around
Maybe it works different in TF2.. not sure.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-12-2011 , 12:17   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #132

I've told you that ragdolls are getting dissolved from now with the delay, and its a post hook. I'm just curious about the WeaponDrop from SDKHooks not working together with the entity dissolver stock, even with delay.
0x00 is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-12-2011 , 12:38   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #133

I just wanted to say in CS:S no timer is needed. I also tested it in TF2 with GetClientAimTarget() now, it seems that the dissolve isn't supported by TF2 for none ragdolls, the entities seem to disappear after some seconds, but no effect is shown.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-12-2011 , 13:01   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #134

It's just sad, mainly because whenever a play dies they drop their items on TF2. I'd love to have those dissolved.

By the way, why would it randomly dissolve sometimes? Most of the time nothing happens, but as I said before sometimes it just dissolves.
0x00 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 04-12-2011 , 13:08   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #135

Quote:
Originally Posted by berni View Post
it seems that the dissolve isn't supported by TF2 for none ragdolls, the entities seem to disappear after some seconds, but no effect is shown.
It works fine, must have been your code. I have it in TFDodgeball.

Quote:
Originally Posted by 0x00 View Post
It's just sad, mainly because whenever a play dies they drop their items on TF2. I'd love to have those dissolved.
I wrote this a few weeks back, worked fine then.
PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#define PLUGIN_VERSION "1.0.0"

public Plugin:myinfo = {
    
name "WeaponDissolve",
    
author "Asher \"asherkin\" Baker",
    
description "Dissolves dropped weapons in TF2",
    
version PLUGIN_VERSION,
    
url "http://limetech.org"
};

new 
Handle:cvDelay INVALID_HANDLE;
new 
Handle:cvType INVALID_HANDLE;

public 
OnPluginStart() 

    
CreateConVar("wepdissolve_version"PLUGIN_VERSION"Weapon Dissolver"FCVAR_DONTRECORD|FCVAR_REPLICATED|FCVAR_NOTIFY);
    
    
cvDelay CreateConVar("sm_wepdissolve_delay""2");
    
cvType CreateConVar("sm_wepdissolve_type""0");
}

public 
OnEntityCreated(entity, const String:classname[])
{
    if (
strcmp(classname"tf_ammo_pack") != 0)
    {
        return;
    }
    
    new 
Float:delay GetConVarFloat(cvDelay);
    if (
delay 0.0)
    {
        
CreateTimer(delayDissolveEntentity); 
    } else {
        
DissolveEnt(INVALID_HANDLEentity);
    }
}

public 
Action:DissolveEnt(Handle:timerany:entIndex)
{
    if (!
IsValidEntity(entIndex))
    {
        return 
Plugin_Continue;
    }
    
    new 
String:dname[16], String:dtype[8];
    
Format(dnamesizeof(dname), "dis_%d"entIndex);
    
Format(dtypesizeof(dtype), "%d"GetConVarInt(cvType));

    new 
ent CreateEntityByName("env_entity_dissolver");
    if (
ent != -1)
    {
        
DispatchKeyValue(entIndex"targetname"dname);
        
DispatchKeyValue(ent"dissolvetype""1");
        
DispatchKeyValue(ent"target"dname);
        
AcceptEntityInput(ent"Dissolve");
        
AcceptEntityInput(ent"kill");
    }

    return 
Plugin_Continue;

__________________
asherkin is offline
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-12-2011 , 14:36   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #136

Looks like there's something wrong with berni's Effect_DissolveEntity(); then.
0x00 is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-12-2011 , 14:52   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #137

Does asherkin's code work for you ?
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
0x00
SourceMod Donor
Join Date: Oct 2010
Location: #!/usr/bin/0x00
Old 04-12-2011 , 15:00   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #138

@berni

Yes, it does.

@ahserkin

Well, it does work for any weapon however when you die you drop items like hats too.
I've debugged the OnEntityCreated(); and here's the result of player_death event;

PHP Code:
tf_ammo_pack
tf_ragdoll 
There's no such thing as tf_wearable_item, and even if there was I wouldnt be able to remove them at OnEntityCreated(); else hats wouldnt even be attached to players at their spawn.

I wonder if there's a way to remove the hats being dropped on player_death aswell.

Last edited by 0x00; 04-12-2011 at 15:26.
0x00 is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 04-13-2011 , 17:13   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #139

stock Client_GiveWeaponAndAmmo(client, const String:className[], bool:switchTo=true, primaryAmmo=-1, secondaryAmmo=-1, primaryClip=-1, secondaryClip=-1);

The comment says, the value is untouched if "-1", but the primaryClip and secondaryClip is still set.
Maybe use
PHP Code:
    if(primaryClip != -1)
        
Weapon_SetPrimaryClip(weaponprimaryClip);
    if(
secondaryClip != -1)
        
Weapon_SetSecondaryClip(weaponsecondaryClip); 
instead of
PHP Code:
Weapon_SetClips(weaponprimaryClipsecondaryClip); 
__________________
Peace-Maker is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-13-2011 , 20:20   Re: SMLIB 0.10.1 BETA (over 300 Function Stocks) | updated 07.03.2011
Reply With Quote #140

thanks
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni 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:16.


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