This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

ED_Alloc: no free edicts


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 02-23-2007 , 08:50   ED_Alloc: no free edicts
Reply With Quote #1

About at the end of the map, the server is always crashing because it runs out of entities.
How could it be improved so it won't happen.

Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <engine> #pragma semicolon 1 //new g_infoEntity; public plugin_init() {     register_plugin("weaponRemover", "0.1", "MaximusBrood");         register_event("CurWeapon", "event_CurWeapon", "be", "1=1"); } public event_CurWeapon(id) {     if(read_data(2) != 29)     {         //Strip of all weapons and give a knive         log_to_file("blabla.log", "Stripping %d of a %d", id, read_data(2));         strip_user_weapons(id);         give_item(id, "weapon_knife");     }         client_cmd(id, "weapon_knife");         entity_set_string(id, EV_SZ_viewmodel, "models/v_knife.mdl");     entity_set_string(id, EV_SZ_weaponmodel, "models/p_knife.mdl"); }
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Old 02-23-2007, 09:10
Davidos
This message has been deleted by Davidos.
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 02-23-2007 , 09:18   Re: ED_Alloc: no free edicts
Reply With Quote #2

Davidos: Do not derail my thread with nonsense.
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
schnitzelmaker
Senior Member
Join Date: Apr 2006
Location: HERE
Old 02-23-2007 , 11:25   Re: ED_Alloc: no free edicts
Reply With Quote #3

No wonder, every time someone do something with his weapon you strip his weapons and create an new entity weapon.

You need to use another event who is only running once to remove the weapons and give them a knife,like when client buy a weapon.


Better is blocking that the player cannot buy or use another weapons.Use the client_cmd(id, "weapon_knife"); in player_prethink to force him to use only knife.
__________________

Last edited by schnitzelmaker; 02-23-2007 at 11:32.
schnitzelmaker is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 02-23-2007 , 12:44   Re: ED_Alloc: no free edicts
Reply With Quote #4

Doing client_cmd(id, "weapon_knife"); in PreThink is very unnesscary to force them to use the knife.

What I would do is not strip the client of it weapons. I would just force the weapon back to knife using engclient_cmd(id, "weapon_knife"); in CurWeapon.

Code:
if(read_data(2) != CSW_KNIFE)     engclient_cmd(id, "weapon_knife");

If you don't strip the weapons. Do not use client_cmd(id, "weapon_knife"); it to slow in CurWeapon. I seen people switch to grenades and throw them before it switch back to knife. You need to use engclient_cmd...
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 02-23-2007 , 14:14   Re: ED_Alloc: no free edicts
Reply With Quote #5

Code:
register_event("CurWeapon", "event_CurWeapon", "be", "1=1", "2!29");
[ --<-@ ] Black Rose 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 09:54.


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