touch help
How would it be possible to see if someone got close enough or touches a sprite? This is for the loot plugin:
http://forums.alliedmods.net/showthread.php?t=3995 It places a loot bag sprite over dead bodies and if you are close enough you can type loot and it will loot the dead body. I would love to change it so that if your just close enough to it it will auto loot for you. Anyone have any ideas on how to see if someone gets close or touches it? |
pfn_touch
get_user_origin |
I see that ptd will be the player so that makes sense but how would I check to make sure that ptr is the sprite? if I did something like entity_get_string(ptr, EV_SZ_classname, name, length)
then I printed the name would it return the name of the sprite? I'm guessing that would be the best way of making sure that the player and the sprite touched...by using entity_get_string and making sure ptd is player and ptr is sprite? |
Something like this: (although I have absolutely no clue if it would work)
Code:
|
There's a good example of pfn_touch in my Satchel Charges plugin.
|
here is my edit of the loot plugin...I got the plugin compiled and I tested it out but its not doing anything when I go next to the loot sprite could someone help me out? maybe env_sprite isn't the classname of the sprite? I'm not sure :?
|
Get entmod, load the sprite, then type entmod_lookingat while looking at it. If that doesn't say anything, or it shows "worldspawn", then do e_search.
|
ok I spawned the sprite with entmod_spawnmodel but when I do e_search or entmod_lookingat I dont see anything that says anything about a sprite
|
I don't know, do e_search and look for it in that.
|
alright I added a print so that it will print the classname of whatever you touch and it was printing player, func_buyzone, weaponbox and the like correctly but when I went up to a the loot sprite it didn't do anything is there anything else I need to do to get it to think the loot sprite is an entity or something?
|
| All times are GMT -4. The time now is 14:28. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.