Raised This Month: $ Target: $400
 0% 

My Scout Removal Script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
-X3N- | DEFAULT
Junior Member
Join Date: Aug 2005
Location: Right Behind You
Old 08-29-2005 , 19:34   My Scout Removal Script
Reply With Quote #1

I cant see why this is removing ALL of the weapons on the map. It is called by set_task that loops every 0.5 seconds. Why is it removing ALL weapons? -Thanks

Code:
public Hidescout() {         new ent         ent = find_ent_by_model(33,"weaponbox","models/w_scout.mdl")         if(ent !=0){             call_think(ent)         } }
I saw a topic about weapon removal, but i believe that it only handles weapons on the ground at the map load.

And, if you're wondering WHY you would ever use this? Well, I own and run a surf server with a few altered mods on it =)
__________________
-X3N- | DEFAULT is offline
Send a message via AIM to -X3N- | DEFAULT Send a message via MSN to -X3N- | DEFAULT
Zenith77
Veteran Member
Join Date: Aug 2005
Old 08-29-2005 , 20:35  
Reply With Quote #2

try replacing the 0 with -1 ....
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
-X3N- | DEFAULT
Junior Member
Join Date: Aug 2005
Location: Right Behind You
Old 08-29-2005 , 20:46  
Reply With Quote #3

I assume you mean
Code:
if(ent !=0){
but i thought that ent would be zero if the find_ent_by_model is not found.

i tried changing that 0 to a -1, but no luck. All of the weaponboxes are being removed.
__________________
-X3N- | DEFAULT is offline
Send a message via AIM to -X3N- | DEFAULT Send a message via MSN to -X3N- | DEFAULT
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 08-29-2005 , 20:51  
Reply With Quote #4

I believe weaponbox is for just about every weapon or whatnot (May be wrong)

try the classname weapon_scout.
pdoubleopdawg is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 08-29-2005 , 20:55  
Reply With Quote #5

i rember a topic about "0" how since 0 basically means false if you use it with the ! it does something with the binary...but i saw this like months ago on a site called cprograming
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-29-2005 , 20:59  
Reply With Quote #6

Quote:
Originally Posted by Zenith77
i rember a topic about "0" how since 0 basically means false if you use it with the ! it does something with the binary...but i saw this like months ago on a site called cprograming
For once, I agree with Zenith. I think it should be !=-1, although I'm not sure.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
-X3N- | DEFAULT
Junior Member
Join Date: Aug 2005
Location: Right Behind You
Old 08-29-2005 , 21:16  
Reply With Quote #7

I'm still trying things, I cant get anything that works, Hope one of the experts drop in and shake this all out.
__________________
-X3N- | DEFAULT is offline
Send a message via AIM to -X3N- | DEFAULT Send a message via MSN to -X3N- | DEFAULT
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 08-29-2005 , 21:42  
Reply With Quote #8

-1 is wrong, he should be checking if it's not 0 as he is.

"If none is found, 0 is returned"

Regardless, I don't know why it's not functioning properly.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
-X3N- | DEFAULT
Junior Member
Join Date: Aug 2005
Location: Right Behind You
Old 08-29-2005 , 21:59  
Reply With Quote #9

Yeah, i knew it should be !=0, but im so stumped as to why it's not recognizing if it's a w_scout, and why it would be deleting ALL of the weaponboxes
__________________
-X3N- | DEFAULT is offline
Send a message via AIM to -X3N- | DEFAULT Send a message via MSN to -X3N- | DEFAULT
-X3N- | DEFAULT
Junior Member
Join Date: Aug 2005
Location: Right Behind You
Old 08-30-2005 , 13:57  
Reply With Quote #10

Can nobody answer this? i figured this would be one of those quick answers....
__________________
-X3N- | DEFAULT is offline
Send a message via AIM to -X3N- | DEFAULT Send a message via MSN to -X3N- | DEFAULT
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:22.


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