Raised This Month: $ Target: $400
 0% 

can't get cs_get_armoury_type to work


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
AndraX2000
Member
Join Date: Mar 2006
Location: 39°57' N 83°14' W
Old 03-27-2006 , 11:49   can't get cs_get_armoury_type to work
Reply With Quote #1

cs_get_armoury_type just doesn't seem to work for me. I am using version 1.70 on linux. No matter which entity it finds, it always thinks that it's type is "23".

Code:
public scour_map() {
	new entindex = -1
	while (entindex = find_ent_by_class(entindex,"armoury_entity")) {
		new weapType = cs_get_armoury_type(entindex)
		server_print("Found an ARMOURY[%d]: %d",entindex,weapType)
	}
	return PLUGIN_CONTINUE
}
shows the following: (btw I used fy_iceworld because there are lots of different armoury entities)
Code:
Found an ARMOURY[59]: 23
Found an ARMOURY[60]: 23
Found an ARMOURY[61]: 23
Found an ARMOURY[62]: 23
Found an ARMOURY[63]: 23
Found an ARMOURY[64]: 23
Found an ARMOURY[65]: 23
Found an ARMOURY[66]: 23
Found an ARMOURY[67]: 23
Found an ARMOURY[68]: 23
Found an ARMOURY[69]: 23
Found an ARMOURY[70]: 23
Found an ARMOURY[71]: 23
Found an ARMOURY[72]: 23
Found an ARMOURY[73]: 23
Found an ARMOURY[74]: 23
Found an ARMOURY[75]: 23
Found an ARMOURY[76]: 23
Found an ARMOURY[77]: 23
Found an ARMOURY[78]: 23
Found an ARMOURY[79]: 23
Found an ARMOURY[80]: 23
Found an ARMOURY[81]: 23
Found an ARMOURY[82]: 23
As you can see, it finds all of the armoury entites, it just thinks that each one is of type "23"
Is this just not working as of 1.70, or am I doing something wrong?
AndraX2000 is offline
teame06
i have a hat
Join Date: Feb 2005
Location: Hat City
Old 03-27-2006 , 13:39  
Reply With Quote #2

Code:
public scour_map() {     new entindex = find_ent_by_class(entindex,"armoury_entity")     new weapType         while (entindex > 0)     {         weapType = cs_get_armoury_type(entindex)         server_print("Found an ARMOURY[%d]: %d",entindex,weapType)                 entindex = find_ent_by_class(entindex,"armoury_entity")             } }
__________________
No private support via Instant Message
GunGame:SM Released
teame06 is offline
Send a message via AIM to teame06
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-27-2006 , 14:21  
Reply With Quote #3

AFAIK there's no cs_get_armoury_type native. It sounds like something for NS
__________________
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
AndraX2000
Member
Join Date: Mar 2006
Location: 39°57' N 83°14' W
Old 03-27-2006 , 14:56  
Reply With Quote #4

Thanks for the quick replies.

teame06:
The problem I'm having isn't really with the structure of the while loop, and the code you present is equivalent. I did try it out, just in case I missed something there, and the results are identical. The problem seems to be that cs_get_armoury_type just doesn't seem to be working.

v3x
cs_get_armoury_type is defined in cstrike.inc. It appears to have been added to cstrike.cpp on 7 Aug 2005 by jonnygothisgun
http://www.tcwonline.org/cgi-bin/vie...ke/cstrike.cpp
and if I vim cstrike_amxx_i386.so I can see that it is in there.

I guess it comes down to: if cs_get_armoury_type works, then I need scripting support because I am not using properly. If it doesn't work, then maybe this thread belongs in bugs.
AndraX2000 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-27-2006 , 17:14  
Reply With Quote #5

Ah, I see now. Thanks.
__________________
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
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 03-27-2006 , 17:23  
Reply With Quote #6

no, you just need to learn to script thats all.

Code:
Found an ARMOURY[52]: 18
Found an ARMOURY[53]: 18
Found an ARMOURY[54]: 22
Found an ARMOURY[57]: 22
Found an ARMOURY[58]: 28
Found an ARMOURY[59]: 22
Found an ARMOURY[60]: 28
Found an ARMOURY[61]: 22
Found an ARMOURY[62]: 28
Found an ARMOURY[63]: 22
Found an ARMOURY[64]: 28
Found an ARMOURY[65]: 22
Found an ARMOURY[66]: 28
Found an ARMOURY[67]: 22
Found an ARMOURY[68]: 28
Found an ARMOURY[69]: 28
Found an ARMOURY[70]: 22
Found an ARMOURY[71]: 28
Found an ARMOURY[86]: 28
Found an ARMOURY[87]: 22
Found an ARMOURY[88]: 28
Found an ARMOURY[89]: 28
Found an ARMOURY[90]: 22
Found an ARMOURY[91]: 28
Found an ARMOURY[92]: 22
Found an ARMOURY[93]: 28
Found an ARMOURY[94]: 22
Found an ARMOURY[95]: 28
Found an ARMOURY[96]: 22
Found an ARMOURY[97]: 28
Found an ARMOURY[98]: 22
Found an ARMOURY[99]: 28
Found an ARMOURY[100]: 22
Found an ARMOURY[103]: 22
Found an ARMOURY[104]: 18
Found an ARMOURY[105]: 18
Found an ARMOURY[122]: 18
Found an ARMOURY[123]: 18
Found an ARM
on aim_map using teame06's exact coding.

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <engine> public plugin_init() {     set_task(10.0,"scour_map") }  public scour_map() {     new entindex = find_ent_by_class(entindex,"armoury_entity")     new weapType         while (entindex > 0)     {         weapType = cs_get_armoury_type(entindex)         server_print("Found an ARMOURY[%d]: %d",entindex,weapType)                 entindex = find_ent_by_class(entindex,"armoury_entity")             } }
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
AndraX2000
Member
Join Date: Mar 2006
Location: 39°57' N 83°14' W
Old 03-27-2006 , 20:24  
Reply With Quote #7

teame06's code and mine were equivalent. In fact, I had a sneaking suspicion that there was something deeper going on. So I installed AMX Mod X on my Windows machine and compiled my original script on it. It worked fine (as does team06's). The fault lay not in the script but in cstrike.h. The error caused cs_get_armoury_type to work on Windows, but not on Linux.

For anyone wanting to use cs_get_armoury_type or cs_set_armoury_type right now on Linux you will need to change line 106 in cstrike.h from
Code:
#define OFFSET_ARMOURY_TYPE                     34 + EXTRAOFFSET
to
Code:
#define OFFSET_ARMOURY_TYPE                     34 + EXTRAOFFSET_WEAPONS
and then recompile.
AndraX2000 is offline
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 03-27-2006 , 20:28  
Reply With Quote #8

really, as on my CS 1.6 server win32 teame06's worked and yet yours did not. Tried them both on iceworld and his returned a bunch of numbers whilst yours only returned 23.
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 03-27-2006 , 20:39  
Reply With Quote #9

Quote:
Originally Posted by GHW_Chronic
really, as on my CS 1.6 server win32 teame06's worked and yet yours did not. Tried them both on iceworld and his returned a bunch of numbers whilst yours only returned 23.


He said that his did work on win32 but not on linux...
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
GHW_Chronic
SourceMod Donor
Join Date: Sep 2004
Location: Texas
Old 03-27-2006 , 20:41  
Reply With Quote #10

and I am saying it DOESNT work on win32. As he stated that it was not his coding that made it return all 23s and yet it was his coding on my win32 that did indeed cause it to return all 23s/
GHW_Chronic is offline
Send a message via AIM to GHW_Chronic
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 16:40.


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