Indentifing an entity (using find_ent)
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 :) |
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. |
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! |
actually u can't move guns by looking at them with that plugin, u'd have to use the classname
|
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? |
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 |
Good!...That helps!!
|
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 |
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! |
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
|
| All times are GMT -4. The time now is 17:18. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.