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

[L4D2]Clear drop items


Post New Thread Reply   
 
Thread Tools Display Modes
rusocop
Junior Member
Join Date: Jun 2018
Location: Spain
Old 03-02-2019 , 10:11   Re: [Any]Remove drop items, non-death drops
Reply With Quote #11

Quote:
[SM] Exception reported: Game event "weapon_drop" does not exist
[SM] Blaming: clear_weapon_drop.smx
[SM] Call stack trace:
[SM] [0] HookEvent
[SM] [1] Line 52, C:\Users\Petr\Desktop\clear_weapon_drop.sp::O nPluginStart
[SM] Unable to load plugin "clear_weapon_drop.smx": Error detected in plugin startup (see error logs)
I´m running Counter Strike Source, solutions? I´ve already changed the weapons lines, the problem is the "HookEvent("weapon_drop", Event_Weapon_Drop);", why?
(Sourcemod 1.9 installed)

Last edited by rusocop; 03-02-2019 at 10:20.
rusocop is offline
Send a message via Skype™ to rusocop
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-02-2019 , 10:20   Re: [Any]Remove drop items, non-death drops
Reply With Quote #12

Looks like CS:S doesn't have this event in hook

I found this one:
https://sm.alliedmods.net/api/index....=show&id=1010&

This topic may also help you:
https://forums.alliedmods.net/showthread.php?t=181037

You can check for CS:S events here:
https://wiki.alliedmods.net/Counter-..._Source_Events
Marttt is offline
rusocop
Junior Member
Join Date: Jun 2018
Location: Spain
Old 03-02-2019 , 10:31   Re: [Any]Remove drop items, non-death drops
Reply With Quote #13

Quote:
Originally Posted by Marttt View Post
Looks like CS:S doesn't have this event in hook

I found this one:
https://sm.alliedmods.net/api/index....=show&id=1010&

This topic may also help you:
https://forums.alliedmods.net/showthread.php?t=181037

You can check for CS:S events here:
https://wiki.alliedmods.net/Counter-..._Source_Events
Lol, I was searching for a auto weapon cleanup plugin (all except c4) for my DM server, and I´m still here xD seems like there are no plugins for this working on css Time to create one

Last edited by rusocop; 03-02-2019 at 10:31.
rusocop is offline
Send a message via Skype™ to rusocop
rusocop
Junior Member
Join Date: Jun 2018
Location: Spain
Old 03-13-2019 , 07:43   Re: [Any]Remove drop items, non-death drops
Reply With Quote #14

Quote:
Originally Posted by AK978 View Post
css version

you need test
Don't forget change line 7

css v2 version
only add line 7 Ignore List(Complete Classname)
Oh, thanks! I´m going to try it right now. (Sry i didnt get any notification of your message)
I saw that you created 2 plugins, the first to clear the needed items, but the 2nd one is to ignore..? Isnt it easier just to keep the 1st plugin and not writing the "weapon_c4" line?

Edit:
Quote:
L 03/13/2019 - 13:11:46: [SM] Blaming: css_clear_weapon_drop_v2.smx
L 03/13/2019 - 13:11:46: [SM] Call stack trace:
L 03/13/2019 - 13:11:46: [SM] [0] GetEntPropEnt
L 03/13/2019 - 13:11:46: [SM] [1] Line 71, C:\Users\...\css_clear_weapon_drop_v2.sp::del _weapon
L 03/13/2019 - 13:11:46: [SM] Exception reported: Property "m_hOwnerweapon" not found (entity 175/weapon_p90)
Edit2:
https://forums.alliedmods.net/showth...=151770&page=3 Im going to try this one (exstream´s message) dont work even checked for the code didnt see any mistake

Last edited by rusocop; 03-13-2019 at 08:37. Reason: news
rusocop is offline
Send a message via Skype™ to rusocop
AK978
Senior Member
Join Date: Jun 2018
Old 03-13-2019 , 10:47   Re: [L4D2]Remove drop items, non-death drops
Reply With Quote #15

delete css v2 version.
AK978 is offline
strikeraot
Senior Member
Join Date: Dec 2018
Location: Viet Nam
Old 10-24-2019 , 07:30   Re: [L4D2]Clear drop items, non-death drops
Reply With Quote #16

How about Removing items when a player disconnected

Last edited by strikeraot; 10-24-2019 at 07:31.
strikeraot is offline
AK978
Senior Member
Join Date: Jun 2018
Old 10-24-2019 , 07:40   Re: [L4D2]Clear drop items, non-death drops
Reply With Quote #17

https://forums.alliedmods.net/showthread.php?p=2644083

change use this version.
AK978 is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 03-07-2020 , 17:17   Re: [L4D2]Clear drop items, non-death drops
Reply With Quote #18

Quote:
Originally Posted by AK978 View Post
I think my version stopped supporting when the player disconnects.
In this case you could add this to your plugin:
PHP Code:
HookEvent("player_disconnect"Event_Player_Disconnect); 
PHP Code:
public Action:Event_Player_Disconnect(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"))
    if (!
IsValidClient(client) || !IsPlayerAlive(client)) return Plugin_Stop;
    for(new 
i5i++){
        new 
entity GetPlayerWeaponSlot(clienti);
        if(
entity <= || entity <= MaxClients || !IsValidEntity(entity)){
            continue;
        }
        
address[entity] = GetEntityAddress(entity);
        
        new 
String:item[32];
        
GetEdictClassname(entityitemsizeof(item));
        
        for(new 
j=0sizeof(ItemDeleteList); j++)
        {
            if (
StrContains(itemItemDeleteList[j], false) != -1)
            {
                
g_timer CreateTimer(GetConVarFloat(ClearTime), del_weaponentity);
            }
        }
    }
    return 
Plugin_Stop;

pd: not tested
xZk is offline
HarryPotter
Veteran Member
Join Date: Sep 2017
Location: Taiwan, Asia
Old 01-06-2021 , 22:08   Re: [L4D2]Clear drop items, non-death drops
Reply With Quote #19

clear_weapon_drop v3.1 [2023-5-10]

ChangeLog:
-Remake Code
-Remove gnome and cola
-Create Native
-Use EntIndexToEntRef and EntRefToEntIndex to remove entity safely
-Remove upgrade pack after deployed on the ground
-Remove weapon after dropped by uncommon infected
__________________

Last edited by HarryPotter; 05-10-2023 at 12:19.
HarryPotter is offline
AK978
Senior Member
Join Date: Jun 2018
Old 01-09-2021 , 00:19   Re: [L4D2]Clear drop items, non-death drops
Reply With Quote #20

v1.8

add hook player_disconnect(z).
EntIndexToEntRef(HarryPotter).

pd: not tested.

Last edited by AK978; 01-09-2021 at 00:20.
AK978 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 12:36.


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