Raised This Month: $ Target: $400
 0% 

script looks fine altough the loop doesn't even start


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 08-24-2005 , 02:13   script looks fine altough the loop doesn't even start
Reply With Quote #1

Ok I wanted a script that removes the entid's of hostage bomb and vip
so I searched around and found the correct classnames
but then I put the script on my server and i doesn't even start the loop a the beginning...
this is my very first script and I made it with a lot of help from hawk
any suggestions?
Code:
#include <amxmodx> #include <engine> #define MAXENTS 512 public plugin_init() {     register_plugin("Objective Remover","1.0","proach")     register_event("RoundTime", "check_obj", "bc")     register_cvar("amx_remhostages","1")     register_cvar("amx_rembomb","1")     register_cvar("amx_remvip","1") } public check_obj() {     client_print(0,print_chat,"[DEBUG] Round end detected.")     new entid     for(entid=0;entid >= 512; entid++)     {         client_print(0,print_chat,"[DEBUG] Loop check beginning.")         new classname[16]         entity_get_string(entid,EV_SZ_classname,classname,15)         if(get_cvar_num("amx_remhostages")==1)         {             client_print(0,print_chat,"[DEBUG] cvar amx_remhostages is 1.")             if(containi(classname,"hostage")!=-1)             {                 client_print(0,print_chat,"[DEBUG] A hostage has been detected.")                 remove_entity(entid)             }             if(containi(classname,"func_hostage_rescue")!=-1)             {                 client_print(0,print_chat,"[DEBUG] A hostage rescue zone has been detected.")                 remove_entity(entid)
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-24-2005 , 02:18  
Reply With Quote #2

Code:
for(entid=0;entid <= get_global_int(GL_maxEntities); entid++)
Try that.

Also, make the classname length 32.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 08-24-2005 , 02:23  
Reply With Quote #3

thx. .g2g now but Ill try today and let you know ;)
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 08-24-2005 , 09:24  
Reply With Quote #4

ok I got this now
Code:
#include <amxmodx> #include <engine> #define MAXENTS 512 public plugin_init() {     register_plugin("Objective Remover","1.0","proach")     register_event("RoundTime", "check_obj", "bc")     register_cvar("amx_remhostages","1")     register_cvar("amx_rembomb","1")     register_cvar("amx_remvip","1") } public check_obj() {     client_print(0,print_chat,"[DEBUG] Round end detected.")     new entid     for(entid=0;entid <= get_global_int(GL_maxEntities); entid++)     {         client_print(0,print_chat,"[DEBUG] Loop check beginning.")         new classname[32]         entity_get_string(entid,EV_SZ_classname,classname,15)         if(get_cvar_num("amx_remhostages")==1)         {             client_print(0,print_chat,"[DEBUG] cvar amx_remhostages is 1.")             if(containi(classname,"hostage")!=-1)             {                 client_print(0,print_chat,"[DEBUG] A hostage has been detected.")                 remove_entity(entid)             }             if(containi(classname,"func_hostage_rescue")!=-1)             {                 client_print(0,print_chat,"[DEBUG] A hostage rescue zone has been detected.")                 remove_entity(entid)             }         }     }     return PLUGIN_HANDLED }

but it gives an error while compiling and it overflows me when I put it on the server..
probably something really stupid .. but what?
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-24-2005 , 09:41  
Reply With Quote #5

Try this:
Code:
#include <amxmodx> #include <engine> public plugin_init() {     register_plugin("Objective Remover","1.0","proach")     register_event("RoundTime", "check_obj", "bc")     register_cvar("amx_remhostages","1")     register_cvar("amx_rembomb","1")     register_cvar("amx_remvip","1") } public check_obj() {     client_print(0,print_chat,"[DEBUG] Round end detected.")     new entid     for(entid=0;entid <= get_global_int(GL_maxEntities); entid++)     {         client_print(0,print_chat,"[DEBUG] Loop check beginning.")         if(!is_valid_ent(entid)) continue         new classname[32]         entity_get_string(entid,EV_SZ_classname,classname,31)         if(get_cvar_num("amx_remhostages")==1)         {             client_print(0,print_chat,"[DEBUG] cvar amx_remhostages is 1.")             if(equal(classname,"hostage_entity"))             {                 client_print(0,print_chat,"[DEBUG] A hostage has been detected.")                 remove_entity(entid)             }             if(equal(classname,"func_hostage_rescue"))             {                 client_print(0,print_chat,"[DEBUG] A hostage rescue zone has been detected.")                 remove_entity(entid)             }         }     } }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 08-24-2005 , 11:00  
Reply With Quote #6

same error
reliable channel overflowed :\
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 08-24-2005 , 11:10  
Reply With Quote #7

Code:
client_print(0,print_chat,"[DEBUG] cvar amx_remhostages is 1.")
Take that out.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 08-24-2005 , 11:56  
Reply With Quote #8

nop.. server just crahses me out..
I'm about to give up :\
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
mysticssjgoku4
Veteran Member
Join Date: Jan 2005
Location: Chicago Heights, IL
Old 08-24-2005 , 12:39  
Reply With Quote #9

Try Putting some return PLUGIN_HANDLED's in there. What I think is happening is that it keeps looping and looping and looing non-stop, that it's causing you to lose connection. or, possible try plugin_continues with elses.
__________________

mysticssjgoku4 is offline
Send a message via AIM to mysticssjgoku4 Send a message via MSN to mysticssjgoku4
Proach
Veteran Member
Join Date: Jan 2005
Location: The Netherlands
Old 08-24-2005 , 12:41  
Reply With Quote #10

good advice.. g2 work but will try tonight or tomorrow
__________________

www.psmod.net (the better psychostats)
PAOL
Proach is offline
Send a message via ICQ to Proach
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:29.


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