Raised This Month: $ Target: $400
 0% 

Removing weaponbox crashes server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
peku33
Junior Member
Join Date: Nov 2008
Old 03-21-2011 , 14:48   Removing weaponbox crashes server
Reply With Quote #1

Hi. I created code for simple DM, all works fine. Then I realised, that after 20 mins of 32 players game whole map is covered with dropped weapons.

So i wrote next plugin:

plugin_init:
RegisterHam(Ham_Spawn, "weaponbox", "clear_weapon", 1);

public clear_weapon(id):
fm_remove_entity(id)

After few mins of play server crashes. I use original STEAM (no dproto / cracks etc)

Code:
meta list
Currently loaded plugins:
      description      stat pend  file              vers      src   load  unlod
 [ 1] AMX Mod X        RUN   -    amxmodx_mm_i386.  v1.8.1.3  ini   Start ANY  
 [ 2] MySQL            RUN   -    mysql_amxx_i386.  v1.8.1.3  pl1   ANY   ANY  
 [ 3] Fun              RUN   -    fun_amxx_i386.so  v1.8.1.3  pl1   ANY   ANY  
 [ 4] Engine           RUN   -    engine_amxx_i386  v1.8.1.3  pl1   ANY   ANY  
 [ 5] FakeMeta         RUN   -    fakemeta_amxx_i3  v1.8.1.3  pl1   ANY   ANY  
 [ 6] CStrike          RUN   -    cstrike_amxx_i38  v1.8.1.3  pl1   ANY   ANY  
 [ 7] CSX              RUN   -    csx_amxx_i386.so  v1.8.1.3  pl1   ANY   ANY  
 [ 8] Ham Sandwich     RUN   -    hamsandwich_amxx  v1.8.1.3  pl1   ANY   ANY  
8 plugins, 8 running
version
Protocol version 48
Exe version 1.1.2.6/Stdio (cstrike)
Exe build: 16:56:12 Mar  8 2010 (4883)
Setting it on task (0.1 / 1.0) or checking whether owner is alive does not give any effect. When i remove empty weapon remover, servers works fine.

What should i do?
peku33 is offline
meTaLiCroSS
Gaze Upon My Hat
Join Date: Feb 2009
Location: Viņa del Mar, Chile
Old 03-21-2011 , 17:02   Re: Removing weaponbox crashes server
Reply With Quote #2

fm_remove_entity

-->

call_think
__________________
Quote:
Originally Posted by joropito View Post
You're right Metalicross
meTaLiCroSS is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-21-2011 , 17:03   Re: Removing weaponbox crashes server
Reply With Quote #3

Why don't you set csdm.cfg (.ini ?) so it auto removes dropped weapons ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
schmurgel1983
Veteran Member
Join Date: Aug 2006
Location: Germany
Old 03-21-2011 , 18:26   Re: Removing weaponbox crashes server
Reply With Quote #4

because he is not running csdm...
__________________

Working on:
nothing
schmurgel1983 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-21-2011 , 18:52   Re: Removing weaponbox crashes server
Reply With Quote #5

This works fine :

RegisterHam( Ham_Touch, "weaponbox", "WeaponBox_Touch", 1 )

public WeaponBox_Touch(iEnt/*, iOther*/)
{
dllfunc(DLLFunc_Think, iEnt)
}
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
peku33
Junior Member
Join Date: Nov 2008
Old 03-27-2011 , 14:50   Re: Removing weaponbox crashes server
Reply With Quote #6

problem solved by changing fm_remove_entity -> dllfunc callthink. Thanks + close
peku33 is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 03-28-2011 , 02:12   Re: Removing weaponbox crashes server
Reply With Quote #7

Quote:
Originally Posted by peku33 View Post
problem solved by changing fm_remove_entity -> dllfunc callthink. Thanks + close
But if you remove weaponbox at Spawn, the weapon that would have been put inside this weaponbox right after spawn is not removed, that's why you would have better to hook Touch that is sent right after Spawn.
__________________
- tired and retired -

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


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