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

Removing entity?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aviram1994
Member
Join Date: Jan 2007
Old 05-24-2008 , 06:19   Removing entity?
Reply With Quote #1

Hey guys,
I fixed my No Melee plugin,
but when ppl restock themselfs they get theirs weapon back,
I thought about removing the entity,
but I couldnt remove it for some reason,
I found out that the classname of the entity is :
func_regenerate
Can anyone code for me a code that removes the entity if the cvar "sm_onlymelee" is 1,
Thanks in advance,
Aviram.
Aviram1994 is offline
labelmaker
Member
Join Date: Mar 2009
Location: Kentucky USA
Old 06-08-2009 , 07:46   Re: Removing entity?
Reply With Quote #2

You dont have to necessarily remove the entity, you can disable it. This is a better option being that you can reenable it if you choose to disable your mod.
Here is what you need to disable it.

PHP Code:
function_DisableResupply(bool:activate
{
    new 
search = -1;
    if (
activate == true)
    {
        while ((
search FindEntityByClassname(search"func_regenerate")) != -1)
            
AcceptEntityInput(search"Disable");
    }
    else
    {
        while ((
search FindEntityByClassname(search"func_regenerate")) != -1)
            
AcceptEntityInput(search"Enable");
    }

Just place function_DisableResupply(true) to disable and function_DisableResupply(false) to reenable it.
__________________

Come Check Out the Popcorn Mod Yourself!!
labelmaker is offline
Send a message via Skype™ to labelmaker
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:05.


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