Raised This Month: $ Target: $400
 0% 

Change movetype on func_door


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 10-22-2009 , 09:37   Change movetype on func_door
Reply With Quote #1

Hi.

PHP Code:
public remove_move() 
{    
    new 
ent 0
    
while(( ent find_ent_by_class(-1"func_door") ))
    {
        
entity_set_int(entEV_INT_movetypeMOVETYPE_NONE)
    }

This code is crashing server. So how to change movetype to none ? I also tried to set entity speed to 0, and movedir to {0.0, 0.0, 0.0}, but server still crashing.

So how prevent these entity from move?
__________________
Join US - custom Zombie Server - Custom Addons:




Last edited by Sn!ff3r; 10-22-2009 at 09:40.
Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-22-2009 , 10:17   Re: Change movetype on func_door
Reply With Quote #2

while(( ent = find_ent_by_class(ent, "func_door") ))
__________________
xPaw is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 10-22-2009 , 10:34   Re: Change movetype on func_door
Reply With Quote #3

PHP Code:
public plugin_init( )
{
    
register_touch"func_door_rotating""player""FwdTouchDoor" );
    
register_touch"func_door""player""FwdTouchDoor" );
}

public 
FwdTouchDooriDoorEntiClient )
{
    return 
PLUGIN_HANDLED;

Jon is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 10-22-2009 , 12:12   Re: Change movetype on func_door
Reply With Quote #4

Quote:
Originally Posted by Jon View Post
PHP Code:
public plugin_init( )
{
    
register_touch"func_door_rotating""player""FwdTouchDoor" );
    
register_touch"func_door""player""FwdTouchDoor" );
}

public 
FwdTouchDooriDoorEntiClient )
{
    return 
PLUGIN_HANDLED;

I'd prefer Ham_Use, just because other ents can call the entity (buttons, triggers etc)
__________________
xPaw is offline
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 10-22-2009 , 12:12   Re: Change movetype on func_door
Reply With Quote #5

xPaw - no changes (ex. in first code when i try to delete entity, my attemp was successfull), so while loop looks ok.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-22-2009 , 12:15   Re: Change movetype on func_door
Reply With Quote #6

If you delete the ent, then you can again use -1 as first index searched.
If you don't delete it, your loop is infinite as you always return the same func_door index, and the server crash (or freeze)

PHP Code:
public remove_move() 
{    
    new 
ent = -1
    
while( ( ent find_ent_by_class(ent"func_door") ) > )
    {
        
entity_set_int(entEV_INT_movetypeMOVETYPE_NONE)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 17:34.


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