PDA

View Full Version : Jet pack



Loveboy
16th January 2013, 14:55
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:


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?

Ni3ls
16th January 2013, 18:30
Post the error

Mitch
16th January 2013, 19:53
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).


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

Loveboy
17th January 2013, 15:19
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();
}

kung foo man
17th January 2013, 15:42
Please give the error message of your first code-snippet, the second one is totally wrong (<Inflictor> etc.) :D

Ni3ls
17th January 2013, 19:20
What Mitch said was to remove the "undefined" in the finishplayerdamage. If u did that it should work