Raised This Month: $ Target: $400
 0% 

Indentifing an entity (using find_ent)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 10-10-2004 , 22:25   Indentifing an entity (using find_ent)
Reply With Quote #1

Okay im working on a plugin ~ when certain criteas are met the plugin forces the player to drop his weapons( actually a specific weapon).. Now heres my questions

1) whats the best way to idenify the weapon on the groudn... mayebe somethign like find_ent_by_owner tho who would the owner be world?
or maybe find_ent_by_model.. i don't know someone help

2) what would be the best way to remove the gun ~ i recall johnny sayin performing call_think would remove it but not sure...

Help would be much appreciated
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
EKS
Veteran Member
Join Date: Mar 2004
Location: Norway
Old 10-11-2004 , 00:28  
Reply With Quote #2

Iv never searched for Ent by owner, it might be faster ( As i assume it only is a Int vaule). But i normaly search by Classname and then model if needed.

Check my TS weapon restriction plugin it does this exact thing.
EKS is offline
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 10-11-2004 , 10:20  
Reply With Quote #3

Ok here this may help alot!

http://forums.alliedmods.net/showthread.php?t=4533+ent

At least to Identify what the entity is at first. Then you can do some backwards testing. I think it should be easy....as well think about what the user is looking at. I thought I saw a plugin that would move entities by what the person is looking at:

http://forums.alliedmods.net/showthread.php?t=2986+view

That may help.

Cheers!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Ingram
Veteran Member
Join Date: May 2004
Old 10-11-2004 , 13:58  
Reply With Quote #4

actually u can't move guns by looking at them with that plugin, u'd have to use the classname
Ingram is offline
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 10-11-2004 , 15:04  
Reply With Quote #5

i might have to to do it the long way... but search by owner owuld be faster faster - the index of the weapon drop is gonna be higher then the number of maxplayers (i think since a weapon that is drop becomes a weaponbox which has its own index - since players are [up to 32] index i presume that the model will be higher then maxplayers - if i could incorperate taht and and the owner (which would be world... can u say world is owner?)

sigh, or search by classname and then model....

back to other question, anyone know whether call_think of on a the ent of weapon remove it?
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 10-11-2004 , 15:40  
Reply With Quote #6

using EKS dumpentinfo i have verified what i thought.. a dropped weapon becomes a weaponbox -- so this means i can do find_ent_by_model(startindex,weaponbox,weapon )

Now all i need to do is test call_think(index) -- which i think will remove it
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 10-11-2004 , 15:44  
Reply With Quote #7

Good!...That helps!!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 10-11-2004 , 16:13  
Reply With Quote #8

well im still having troubles, one thing is i can't get the weapon removed - i think i did this wrong

ent = find_ent_by_model(32,"weaponbox","models/w_awp.mdl")

i don't know... help appreciated
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
Zor
Veteran Member
Join Date: Mar 2004
Location: Toronto, ON
Old 10-11-2004 , 16:31  
Reply With Quote #9

Havent fooled with Entities yet. Im working on a spawn point mover. But havent really gotten into it yet...just getting some basics in.

Sorry Cheers!
__________________
Zor is offline
Send a message via AIM to Zor Send a message via MSN to Zor Send a message via Yahoo to Zor
Da Bishop
Senior Member
Join Date: Aug 2004
Location: Chester County PA
Old 10-11-2004 , 18:41  
Reply With Quote #10

ive myself have only done a little with entities - since im getting just about no wheres right now.. its not very fun... hopefully someone that knows their stuff responds.. maybe BAIL or JGHG or PM some1 lol
__________________
Anything that is done can only be done better by urself - since life is a opinion make it the way urs feel its best

~live by it
Da Bishop is offline
Send a message via MSN to Da Bishop
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 17:18.


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