Is that possible to add something to this for picking up and moving a player?
So:
When I press G aiming on:
-a crate - I can pickup it
+
-a player - I can pickup he/she
So:
When I press G aiming on:
-a crate - I can pickup it
+
-a player - I can pickup he/she
Code:
PickupCrate()
{
self endon("death");
self notifyOnPlayerCommand( "crateup", "+frag" );
for(;;)
{
self waittill( "crateup" );
vec = anglestoforward(self getPlayerAngles());
end = (vec[0] * 100, vec[1] * 100, vec[2] * 100);
entity = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+(vec[0] * 100, vec[1] * 100, vec[2] * 100), 0, self )[ "entity" ];
if( isdefined(entity.model) )
{
self thread moveCrate( entity );
self waittill( "crateup" );
{
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale( "primary" );
}
}
}
}
moveCrate( entity )
{
self endon("crateup");
for(;;)
{
entity.angles = self.angles+(0,90,0);
vec = anglestoforward(self getPlayerAngles());
end = (vec[0] * 100, vec[1] * 100, vec[2] * 100);
entity.origin = (self gettagorigin("tag_eye")+end);
self.moveSpeedScaler = 1;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale( "primary" );
wait 0.05;
}
}