Raised This Month: $ Target: $400
 0% 

No free edicts error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lieutenant
Junior Member
Join Date: Oct 2007
Location: US
Old 10-01-2007 , 21:48   No free edicts error
Reply With Quote #1

i just cant figure why i get that error. I compiled the plugin perfectly. Ran the plugin on the server and it crashes. I tried running debug mode but no help. So iam hoping someone can help me out. Thanks



PHP Code:
 
#include <amxmodx>
#include <amxmisc>
#include <fun>
new knifeonly 0;
public 
cmdknives_only(id){
 new 
arg[2];
 
read_argv 1arg);
 
set_hudmessage 2001000, -1.00.2501.05.00.10.2);
 
 if ( 
equali arg"1" ) ) {
  
knifeonly 1;
  
client_cmd id"weapon_knife" );
  
console_print id"Knives Only has been turned on." );
  
show_hudmessage 0"Knives Only has been turned on." );
  
set_task(0.1,"strip",id);
  
set_task(0.1,"client_authorized",id);
 }
 else if ( 
equali arg"0" ) ) {
  
knifeonly 0
  console_print 
id"Knives Only has been turned off." );
  
show_hudmessage 0"Knives Only has been turned off." );
  
client_print(idprint_chat"KNIVES ONLY MOD HAS BEEN TURNED OFF.")
  
set_hudmessage(02550, -1.0, -7.517.07.00.10.22)
  
show_hudmessage(id"KNIVES ONLY MOD HAS BEEN TURNED OFF.")
 }
 else {
  if ( 
knifeonly == ){
   
console_print id"Usage: amx_knivesonly 1 = 0n 0 = off Currently: OFF" );
  }
  if ( 
knifeonly == ){
   
console_print id"Usage: amx_knivesonly 1 = 0n 0 = off Currently: ON" );
  }
 }
 return 
PLUGIN_CONTINUE;
}
public 
check(id){
 if(
is_user_alive(id) && knifeonly == 1) {
  new 
clipammo;
  new 
usersweapon get_user_weapon idclipammo );
  if(
usersweapon == CSW_KNIFE) {
   
// Do Nothing
  
}
  else {
   
set_task(0.1,"strip",id);
  }
 }
 return 
PLUGIN_CONTINUE;
}
public 
post_message(id) {
 
client_print(idprint_chat"KNIVES ONLY MOD IS ENABLED. NO WEAPONS ALLOWED.")
 
set_hudmessage(1002000, -1.0, -7.517.07.00.10.22)
 
show_hudmessage(id"KNIVES ONLY MOD IS ENABLED. NO WEAPONS ALLOWED.")
 return 
PLUGIN_CONTINUE;
}
public 
strip(id) {
 new 
origin[3];
 
get_user_origin (id,origin);
 
origin[2] -= 500;
 
set_user_origin (id,origin);
 
strip_user_weapons(id);
 
give_item(id,"weapon_knife");
 new 
origin2[3];
 
get_user_origin (id,origin2);
 
origin2[2] += 500;
 
set_user_origin (id,origin2);
 
set_task(2.5,"check",id);
 return 
PLUGIN_CONTINUE;
}
public 
knife(id) {
 
//DO NOT REMOVE THE NON-WORKING AUTO-ON BELOW!!! IT'LL ALSO CAUSE THE NO EDICTS CRASH. DUNNO WHY THOUGH.
 
new MapName[32];
 
get_mapname(MapName,31);
 if(
equali(MapName,"ka_futurefight") != -|| equali(MapName,"woohoo_cars")) {
  
// DO NOT MAKE THE NEXT LINE knifeonly = 1. IT WILL CAUSE THE NO FREE EDICTS CRASH.
  
set_cvar_num("knifeonly",1);
 }
 
 if(
is_user_alive(id) && knifeonly == 1) {
  new 
clipammo;
  new 
usersweapon get_user_weapon idclipammo );
  if(
usersweapon == CSW_KNIFE) {
   
// Do Nothing
  
}
  else {
   new 
origin[3];
   
get_user_origin (id,origin);
   
origin[2] -= 500;
   
set_user_origin (id,origin);
   
strip_user_weapons(id);
   
give_item(id,"weapon_knife");
   new 
origin2[3];
   
get_user_origin (id,origin2);
   
origin2[2] += 500;
   
set_user_origin (id,origin2);
   
set_task(2.5,"check",id);
  }
 }
 return 
PLUGIN_CONTINUE;
}
public 
fullupdateblock() {
 return 
PLUGIN_HANDLED
}
public 
cmdBlock(id) {
 if (
knifeonly == 1) {
  return 
PLUGIN_HANDLED
 
}
 return 
PLUGIN_CONTINUE
}
public 
client_authorized(id) { // This thing works automatically without any need for any set_tasks. It does the role of is_user_connected(id).
 
if(knifeonly == 1) {
  
set_task(5.0,"post_message",id);
 }
 
// If there is some other error, try deleting the next line. I forgot whether or not client_authorized needs it.
 
return PLUGIN_CONTINUE
}
public 
plugin_init () {
 
register_plugin "Knives Only""1.0""By: Johnny - Original: SilverTide" );
 
register_concmd "amx_knivesonly""cmdknives_only"ADMIN_LEVEL_A"- Turns on or off Knives Only." );
 
register_event "CurWeapon""knife""b" );
 
 
//Block Commands (Buying, etc.)
 
register_clcmd("buy""cmdBlock")
 
register_clcmd("buyammo1""cmdBlock")
 
register_clcmd("buyammo2""cmdBlock")
 
register_clcmd("buyequip""cmdBlock")
 
register_clcmd("cl_autobuy""cmdBlock")
 
register_clcmd("cl_rebuy""cmdBlock")
 
register_clcmd("cl_setautobuy""cmdBlock")
 
register_clcmd("cl_setrebuy""cmdBlock")
 
register_clcmd("galil","cmdBlock")
 
register_clcmd("defender","cmdBlock")
 
register_clcmd("ak47","cmdBlock")
 
register_clcmd("cv47","cmdBlock")
 
register_clcmd("scout","cmdBlock")
 
register_clcmd("sg552","cmdBlock")
 
register_clcmd("krieg552","cmdBlock")
 
register_clcmd("awp","cmdBlock")
 
register_clcmd("magnum","cmdBlock")
 
register_clcmd("g3sg1","cmdBlock")
 
register_clcmd("d3au1","cmdBlock")
 
register_clcmd("famas","cmdBlock")
 
register_clcmd("clarion","cmdBlock")
 
register_clcmd("m4a1","cmdBlock")
 
register_clcmd("aug","cmdBlock")
 
register_clcmd("bullpup","cmdBlock")
 
register_clcmd("sg550","cmdBlock")
 
register_clcmd("krieg550","cmdBlock")
 
register_clcmd("glock","cmdBlock")
 
register_clcmd("9x19mm","cmdBlock")
 
register_clcmd("usp","cmdBlock")
 
register_clcmd("km45","cmdBlock")
 
register_clcmd("p228","cmdBlock")
 
register_clcmd("228compact","cmdBlock")
 
register_clcmd("deagle","cmdBlock")
 
register_clcmd("nighthawk","cmdBlock")
 
register_clcmd("elites","cmdBlock")
 
register_clcmd("fn57","cmdBlock")
 
register_clcmd("fiveseven","cmdBlock")
 
register_clcmd("m3","cmdBlock")
 
register_clcmd("12gauge","cmdBlock")
 
register_clcmd("xm1014","cmdBlock")
 
register_clcmd("autoshotgun","cmdBlock")
 
register_clcmd("mac10","cmdBlock")
 
register_clcmd("tmp","cmdBlock")
 
register_clcmd("mp","cmdBlock")
 
register_clcmd("mp5","cmdBlock")
 
register_clcmd("smg","cmdBlock")
 
register_clcmd("ump45","cmdBlock")
 
register_clcmd("p90","cmdBlock")
 
register_clcmd("c90","cmdBlock")
 
register_clcmd("m249","cmdBlock")
 
register_clcmd("primammo","cmdBlock")
 
register_clcmd("secammo","cmdBlock")
 
register_clcmd("vest","cmdBlock")
 
register_clcmd("vesthelm","cmdBlock")
 
register_clcmd("flash","cmdBlock")
 
register_clcmd("hegren","cmdBlock")
 
register_clcmd("sgren","cmdBlock")
 
register_clcmd("nvgs","cmdBlock")
 
register_clcmd("defuser","cmdBlock")
 
register_clcmd("shield","cmdBlock")
 
register_clcmd("fullupdate""fullupdateblock")

Lieutenant is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-01-2007 , 22:43   Re: No free edicts error
Reply With Quote #2

I think it's something with strip_weapon, weapons (entities) are not really removed, and when there are too much entities you get this error.
ConnorMcLeod is offline
Drak
Veteran Member
Join Date: Jul 2005
Old 10-01-2007 , 23:37   Re: No free edicts error
Reply With Quote #3

In the plugin, it says:
Quote:
Originally Posted by The Plugin
// DO NOT MAKE THE NEXT LINE knifeonly = 1. IT WILL CAUSE THE NO FREE EDICTS CRASH.
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
Lieutenant
Junior Member
Join Date: Oct 2007
Location: US
Old 10-02-2007 , 01:11   Re: No free edicts error
Reply With Quote #4

Quote:
Originally Posted by connorr View Post
I think it's something with strip_weapon, weapons (entities) are not really removed, and when there are too much entities you get this error.
So is thier any way to fix it b/c it? Or at least a different way? Yeah i know that it says knifesonly=1 causes crash.
Lieutenant is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 10-02-2007 , 09:01   Re: No free edicts error
Reply With Quote #5

Longs you have access to the loadup of hlds or however your running it.

Example of mine:
-dll addons/metamod/dlls/metamod.dll -num_edicts 1928

For me that allows 2048 entities
Each player slot creates 15 additional edicts.

So for a 16 slot server you'd set -num_edicts 1808, unless you want to go beyond 2048 which you can.


Regards,

Orang
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
Lieutenant
Junior Member
Join Date: Oct 2007
Location: US
Old 10-02-2007 , 10:05   Re: No free edicts error
Reply With Quote #6

Do i modify the metamod.dll to change the number of edicts? Also if their is any other way to change my code to not get that error that would be great too.
Lieutenant is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-02-2007 , 10:21   Re: No free edicts error
Reply With Quote #7

Don't strip players weapons, check players weapon,if it's not a knife make them take their knife

Code:
if(weapon != CSW_KNIFE)  engclient_cmd(id, "weapon_knife")
ConnorMcLeod is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 10-02-2007 , 11:42   Re: No free edicts error
Reply With Quote #8

Quote:
Originally Posted by Lieutenant View Post
Do i modify the metamod.dll to change the number of edicts? Also if their is any other way to change my code to not get that error that would be great too.
Load Steam, right click on Dedicated Server select Properties then click on Set launch options...
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
Mani Katti
Junior Member
Join Date: Feb 2006
Old 10-02-2007 , 17:53   Re: No free edicts error
Reply With Quote #9

Quote:
Originally Posted by connorr View Post
Don't strip players weapons, check players weapon,if it's not a knife make them take their knife

Code:
if(weapon != CSW_KNIFE)  engclient_cmd(id, "weapon_knife")
If I'm correct... You can still switch to your grenades if you do fast switch fast enough... That's why he used strip_user_weapons instead...
Mani Katti is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-02-2007 , 17:59   Re: No free edicts error
Reply With Quote #10

Not with engclient_cmd.
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 16:09.


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