View Single Post
tryout101
Member
Join Date: Mar 2009
Old 06-16-2016 , 05:47   Re: Modern warfare 2 Mod v1.3.6b
Reply With Quote #406

I need help seriously. Its driving me crazy. I can't make the sentry part of the plugin work. It shoots blank. It doesn't damage or hurt anyone.

I did lots of searching, I changed one bit over another but I cant make it work or understand what to do.

*EDIT* : After much trial and error and learning.

I fiddled alot with the part of the source code that handles damage, by using fakedamage(). I have come to realize the problem occurs because it isn't picking up the player entities. Therefore by the "if" check it wont pass to fake the damage.

That function is suppose to pickup the sentrybullet entity and player entity. But the darn problem it only picks up the interaction of [sentry] entity and [sentrybullet] entity.
PHP Code:
// It uses pfn_touch(ptr, ptd), ptr grabs the sentrybullet class entity, as the player ptd creates it.
// But soon the build sentry code goes into effect and creates 2 other entities, [sentrybase] and [sentry].
// Somehow the [sentry] entity and [sentrybullet] entity are the only ones that get picked up by the pfn_touch() function. 
*EDIT* : Solved the bug completely. Heck Yeah ! Check below for fix and download.

It was due to [sentrybullet] and [sentry] touching eachother in origin coordinates so the functions picked them up only, instead of player. Took me newbie two damn days of full time hours to figure it out. A Pro could have figured it out in 5 mins. Just changed entity_origin from 20-25. My alternate solution is also below this post.


PHP Code:
sentry_fire(iEntFloat:entity_origin[3], Float:target_origin[3]){
    static 
bltFloat:speed 2500.0
    target_origin
[2] += 35.0    // changed from -10 to +35, distance around the sentry where no-one gets hit, + for lower blindspot, - for higher blondspot
    
entity_origin[2] += 25.0    // changed from 20-25, origin of the bullet entity to be 24 and higher because if it touches sentry entity it will fail to hit. 
Attached Files
File Type: sma Get Plugin or Get Source (cod_mw2_mod.sma - 760 views - 189.6 KB)

Last edited by tryout101; 06-24-2016 at 10:03. Reason: Additonal Info
tryout101 is offline