AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   drop a object with velocity and on touch doesnt work (https://forums.alliedmods.net/showthread.php?t=86704)

tuty 03-01-2009 13:32

drop a object with velocity and on touch doesnt work
 
Hi, i made this code

PHP Code:

new Float:iVelocity], Float:iOrigin];
velocity_by_aimidrandom_num80400 ), iVelocity );
pevidpev_originiOrigin );
set_peventpev_originiOrigin );
set_peventpev_classnamegClassname );
engfuncEngFunc_SetModelent,MODEL );
engfuncEngFunc_SetSizeentMINSZMAXSZ );
set_peventpev_solidSOLID_BBOX );
set_peventpev_movetypeMOVETYPE_TOSS );
set_peventpev_velocityiVelocity );
dllfuncDLLFunc_Spawnent );
// engfunc( EngFunc_DropToFloor, ent );
fm_set_renderingentkRenderFxGlowShell02550kRenderNormal70 );
cs_remove_user_nvgid ); // a stock... ^^ 

the problem is, when i use dllfunc( DLLFunc_Spawn, ent ); the object will dropped with nice velocity but i cant touch him... and if i use engfunc( EngFunc_DropToFloor, ent ); the velocity doesn't work and i can touch the model. I need a little help :wink:

Arkshine 03-01-2009 13:46

Re: drop a object with velocity and on touch doesnt work
 
What do you mean exactly by 'can't touch him' ?

tuty 03-01-2009 13:57

Re: drop a object with velocity and on touch doesnt work
 
i mean if i touch the object to remove it....:|

Exolent[jNr] 03-01-2009 13:58

Re: drop a object with velocity and on touch doesnt work
 
@arkshine
If he uses EngFunc_DropToFloor, then the velocity doesn't work, but the entity is solid.
If he doesn't, then the velocity works but the entity is not solid.


tuty beat me.

@tuty
Always set the entity's size and solid at the last point of creating it.

tuty 03-01-2009 15:36

Re: drop a object with velocity and on touch doesnt work
 
Quote:

Originally Posted by Exolent[jNr] (Post 771751)
@arkshine
If he uses EngFunc_DropToFloor, then the velocity doesn't work, but the entity is solid.
If he doesn't, then the velocity works but the entity is not solid.


tuty beat me.

@tuty
Always set the entity's size and solid at the last point of creating it.


actualy won't work.. :cry:
In other plugins maded by me with models and solid models works. but in this is something strange..

Can you give me an example .. a good example because won't work..:shock:

Exolent[jNr] 03-02-2009 07:24

Re: drop a object with velocity and on touch doesnt work
 
Remove the DLLFunc_Spawn and try.

tuty 03-02-2009 07:50

Re: drop a object with velocity and on touch doesnt work
 
i allready do that lol :mrgreen:


but if i remove dllfunc spawn will throw but without velocity ... :/

Arkshine 03-02-2009 07:53

Re: drop a object with velocity and on touch doesnt work
 
What's the entity you want to spawn ? info_target ?

tuty 03-02-2009 07:56

Re: drop a object with velocity and on touch doesnt work
 
yup :mrgreen:

Arkshine 03-02-2009 08:01

Re: drop a object with velocity and on touch doesnt work
 
Try that :

Code:
new Float:iVelocity[ 3 ], Float:iOrigin[ 3 ]; velocity_by_aim( id, random_num( 80, 400 ), iVelocity ); pev( id, pev_origin, iOrigin ); set_pev( ent, pev_classname, gClassname ); set_pev( ent, pev_origin, iOrigin ); set_pev( ent, pev_solid, SOLID_BBOX ); set_pev( ent, pev_movetype, MOVETYPE_TOSS ); engfunc( EngFunc_SetModel, ent, MODEL ); engfunc( EngFunc_SetSize, ent, MINSZ, MAXSZ ); engfunc( EngFunc_SetOrigin, ent, iOrigin ); set_pev( ent, pev_velocity, iVelocity ); fm_set_rendering( ent, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 70 ); cs_remove_user_nvg( id ); // a stock... ^^


All times are GMT -4. The time now is 17:04.

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