Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is that possible?
#1
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


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;
    }

}
Reply

#2
(07-09-2012, 09:05)TheRaZ Wrote: 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
+
- OMA

Yes, search on google for "mw2 forge mod with players" or something like that, this stuff is old Big Grin
Reply

#3
(07-09-2012, 09:14)Yamato Wrote: Yes, search on google for "mw2 forge mod with players" or something like that, this stuff is old Big Grin

I haven't found 1 forge mod where I can pickup players, therefore asking that here.
Reply

#4
Try
Code:
entity SetOrigin((self gettagorigin("tag_eye")+end));
Insted of entity.origin.
[Image: azuw.jpg]
Reply

#5
I have found this one on google, I dont know who is its creator Confused :

Code:
Pick_up()
{
        self endon("death");
        self endon("player_killed");
        self endon("joined_spectators");
        self endon("disconnect");

        for(;;)
        {
                for(;!self fragButtonPressed();)
                        wait 0.05;
                      
                trace = bulletTrace(self eyePos(), self eyePos() + vector_scale(anglesToForward(self getPlayerAngles()), 9999999), true, self);
                distance = distance(self eyePos(), trace["position"]);
                entity = trace["entity"];
              
                if(isDefined(entity) && entity.classname == "player")
                {
                        self iPrintLn("You picked up " + entity.name + "^1!");
                        entity iPrintLn("Admin " + self.name + " has picked you.");
                              
                        linker = spawn("script_origin", entity.origin);
                        entity linkTo(linker);
                              
                        for(;self fragButtonPressed();)
                                wait 0.05;
                                      
                        for(;!self useButtonPressed() && isDefined(entity);)
                        {      
                                trace = bulletTrace(self eyePos(), self eyePos() + vector_scale(anglesToForward(self getPlayerAngles()), distance), false, entity);
                                distance = distance(self eyePos(), trace["position"]);
                                      
                                if(self fragButtonPressed() && !self attackButtonPressed())
                                        distance -= 15;
                                else if(self meleeButtonPressed() && self useButtonPressed())
                                        distance += 15;
                                              
                                trace = bulletTrace(self eyePos(), self eyePos() + vector_scale(anglesToForward(self getPlayerAngles()), distance), false, entity);
                                linker.origin = trace["position"];
                                      
                                wait 0.05;
                        }
                              
                        if(isDefined(entity))
                        {
                                self iPrintLn("You dropped " + entity.name + "^1!");
                                entity iPrintLn("" + self.name + " has dropped you.");
                                      
                                entity unlink();
                        }

                        linker delete();
                }
              
                for(;self fragButtonPressed();)
                        wait 0.05;
        }
}

eyePos()
{
        if(self getStance() == "prone")
                vec = self.origin + (0, 0, 11);
        else if(self getStance() == "prone")
                vec = self.origin + (0, 0, 40);
        else
                vec = self.origin + (0, 0, 60);
              
        return vec;
}
Reply

#6
@zxz0O0 tried but not worked.

@Yamato thanks for it, but it crashing the server when loading Sad
I don't know how to fix it...
Reply

#7
(07-09-2012, 13:12)TheRaZ Wrote: @zxz0O0 tried but not worked.

Also replace
Code:
if( isdefined(entity.model) )
with
Code:
if( isdefined(entity.model) || IsPlayer(entity) )
[Image: azuw.jpg]
Reply

#8
[quote='zxz0O0' pid='81208' dateline='1341837669']
Still not working.
Code:
if( isdefined(entity.model) || IsPlayer(entity) )

When i use this i cannot move crates, just rotate them:
Code:
entity SetOrigin((self gettagorigin("tag_eye")+end));


Bonus.
Reply

#9
entity.origin = self gettagorigin("tag_eye")+end;
Reply

#10
(07-09-2012, 13:56)Yamato Wrote: entity.origin = self gettagorigin("tag_eye")+end;

Same result as the default "entity.origin = (self gettagorigin("tag_eye")+end);"
Reply



Forum Jump:


Users browsing this thread:
4 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.