Results 1 to 6 of 6

Thread: Jet pack

  1. #1
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts

    Jet pack

    Hi guys i want to make jetpack but the problem is i can't :/ in a map with trigger i can.. but i want it to make it in a shop.
    so if guy press F he will some fly, if press again he fly more.

    script:
    Code:
    bounce( pos, power )
    {
        oldhp = self.health;
        self.health = self.health + power;
        self finishPlayerDamage( self, self, power, 0, "MOD_PROJECTILE", "panzerschreck_mp", undefined, pos, "none", 0 );
        self.health = oldhp;
    }
    
    jumppad_think()
    {
        while (1)
        {
    
            if (!isDefined(self.lastJump))
                self.lastJump = 0;
    
            //iprintlnbold(getTime() - player.lastJump);
            if (getTime() - self.lastJump <= 1000)
            {
                wait 0.05;
                continue;
            }
            self.lastJump = getTime();
    
    	if (self useButtonPressed())
    	{
            self iprintlnbold("^1~^7JUMP^1~");
            self bounce((0,0,1), 1000);
            self bounce((0,0,1), 1000);
            self bounce((0,0,1), 1000);
    	}
        }
    }
    
    initJumppads()
    {
    thread jumppad_think();
    }
    
    main()
    {
        initJumppads();
    maps\mp\_load::main();
    }
    Edit izno: added [ code] tags!
    Keep using [ code] tags plz!

    but it give me errors.. pls i need help how i make the jetpack with press f in a shop?
    Last edited by IzNoGoD; 16th January 2013 at 16:30.

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Post the error

  3. The Following User Says Thank You to Ni3ls For This Useful Post:

    kung foo man (16th January 2013)

  4. #3
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by Loveboy
    Code:
    bounce( pos, power )
    {
        oldhp = self.health;
        self.health = self.health + power;
        self finishPlayerDamage( self, self, power, 0, "MOD_PROJECTILE", "panzerschreck_mp", undefined, pos, "none", 0 );
        self.health = oldhp;
    }
    Your finishPlayerDamage has too many parameters. After weapon you need to have the direction (aka pos).

    Code:
    FinishPlayerDamage( <Inflictor>, <Attacker>, <Damage>, <Damage Flags>, <Means of Death>, <Weapon>, 
    <Direction>, <Hit Loc>, <OffsetTime> )

  5. The Following User Says Thank You to Mitch For This Useful Post:

    kung foo man (16th January 2013)

  6. #4
    Lieutenant Loveboy's Avatar
    Join Date
    Nov 2012
    Posts
    546
    Thanks
    229
    Thanked 72 Times in 46 Posts
    it give me error:

    ******* script compile error *******
    bad syntax: (file 'maps/mp/mp_jumppad.gsc', line 5)
    FinishPlayerDamage( <Inflictor>, <Attacker>, <Damage>, <Damage Flags>, <Means of Death>, <Weapon>, <Direction>, <Hit Loc>, <OffsetTime> );
    *
    ************************************
    script:

    [ code]
    bounce( pos, power )
    {
    oldhp = self.health;
    self.health = self.health + power;
    FinishPlayerDamage( <Inflictor>, <Attacker>, <Damage>, <Damage Flags>, <Means of Death>, <Weapon>, <Direction>, <Hit Loc>, <OffsetTime> );
    self.health = oldhp;
    }

    jumppad_think()
    {
    while (1)
    {

    if (!isDefined(self.lastJump))
    self.lastJump = 0;

    //iprintlnbold(getTime() - player.lastJump);
    if (getTime() - self.lastJump <= 1000)
    {
    wait 0.05;
    continue;
    }
    self.lastJump = getTime();

    if (self useButtonPressed())
    {
    self iprintlnbold("^1~^7JUMP^1~");
    self bounce((0,0,1), 1000);
    self bounce((0,0,1), 1000);
    self bounce((0,0,1), 1000);
    }
    }
    }

    initJumppads()
    {
    thread jumppad_think();
    }

    main()
    {
    initJumppads();
    maps\mp\_load::main();
    }

  7. #5
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts
    Please give the error message of your first code-snippet, the second one is totally wrong (<Inflictor> etc.)
    timescale 0.01

  8. #6
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    What Mitch said was to remove the "undefined" in the finishplayerdamage. If u did that it should work

  9. The Following User Says Thank You to Ni3ls For This Useful Post:

    kung foo man (17th January 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •