Raised This Month: $51 Target: $400
 12% 

Bomb gets stuck inside player!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 14:39   Bomb gets stuck inside player!
Reply With Quote #1

[SOLVED]

I have a plugin that automatically drops the bomb when a player with the bomb spawns in a bombzone. This is for a retake scenario server, but the bomb gets stuck inside the player planting.

I have tried turning the gravity very high so that the bomb falls to the ground very fast, but this was not very good for several reasons.

And then I tried to give the player noclip for a second before dropping the bomb, this worked a few times but is not very good..

I also tried slapping the player.. This is very ugly and did not work every time..

Is there any good solution to this?

Last edited by suhdude; 11-11-2017 at 17:08.
suhdude is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 17:13   Re: Bomb gets stuck inside player!
Reply With Quote #2

Code:
public PlantABomb( player ) {     new iEntity = create_entity( "weapon_c4" );           if( !iEntity )         return;           DispatchKeyValue( iEntity, "detonatedelay", "50" );     DispatchSpawn( iEntity );           new Float:origin[ 3 ];     pev( player, pev_origin, origin );           engfunc( EngFunc_SetOrigin, iEntity, origin );           force_use( iEntity, iEntity ); // This plants it }
suhdude is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-10-2017 , 17:18   Re: Bomb gets stuck inside player!
Reply With Quote #3

To anyone who tried this script and think its working:
It only does when you are alone on a server for some reason.

I've tried it with a friend, and one of us gets stuck all the time while the other can plant without any issue.
suhdude is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 15:06   Re: Bomb gets stuck inside player!
Reply With Quote #4

Code:
    new Float:origin[ 3 ];     pev( player, pev_origin, origin );           engfunc( EngFunc_SetOrigin, iEntity, origin );

It must have something to do with this section, is it not possible to make it spawn a little bit away from the players origin? So that it does not get stuck?

Thanks

Last edited by suhdude; 11-11-2017 at 15:07.
suhdude is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-11-2017 , 15:17   Re: Bomb gets stuck inside player!
Reply With Quote #5

Stop multi posting, learn how to use the edit button.

Edit: You can start by doing something like this, you can get more sophisticated later.
PHP Code:
    new Float:origin]; 
    
pevplayerpev_originorigin ); 
     
    
engfuncEngFunc_SetOriginiEntityorigin ); 

PHP Code:
    new Float:origin]; 
    
pevplayerpev_originorigin ); 
     
    
origin] += 30.0
    
// or
    
origin] += 30.0
        
    engfunc
EngFunc_SetOriginiEntityorigin ); 
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.

Last edited by wickedd; 11-11-2017 at 15:40.
wickedd is offline
suhdude
Senior Member
Join Date: Mar 2016
Location: Sweden
Old 11-11-2017 , 17:06   Re: Bomb gets stuck inside player!
Reply With Quote #6

Quote:
Originally Posted by wickedd View Post
Stop multi posting, learn how to use the edit button.

Edit: You can start by doing something like this, you can get more sophisticated later.
PHP Code:
    new Float:origin]; 
    
pevplayerpev_originorigin ); 
     
    
engfuncEngFunc_SetOriginiEntityorigin ); 

PHP Code:
    new Float:origin]; 
    
pevplayerpev_originorigin ); 
     
    
origin] += 30.0
    
// or
    
origin] += 30.0
        
    engfunc
EngFunc_SetOriginiEntityorigin ); 
Sorry, I will.

Thank you so much!
suhdude is offline
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 07:20.


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