• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Request] Spawning a crate
#1
Question 
Heyho
first of all, hello to everyone Smile
Im new and im planning to release some of my mods here soon.
But now i got a problem spawning a crate ... i hope someone can help me?

The code for the crates:
Code:
CreateBlocks(pos, angle)
{
    if(!level.CreateBunkers) return;
        block = spawn("script_model", pos, 1 );
        block setModel( level.crateModelFriendly );    
        block.angles = angle;
        wait 0.01;
}

roundUp( floatVal )
{
    if ( int( floatVal ) != floatVal )
        return int( floatVal+1 );
    else
        return int( floatVal );
}

And my code to spawn a crate:
Code:
self CreateBlocks(self.origin, (self getPlayerAngles()));
but no crate appears.
Whats the problem?

Vanoq
(sry for my bad english, im ger Smile)
  Reply
#2
because ur map functions are jacked up lol remove the if statement line
  Reply
#3
*facepalm*
Code:
self CreateBlocks(self.origin, self getPlayerAngles());

((self getPlayerAngles()) is not a valid vector....

((123,456,789));
[Image: 30xhrep.png]

A casual conversation between barata and I about Nukem.
  Reply
#4
Code:
CreateBlocks(pos, angle)
{
        block = spawn("script_model", pos, 1 );
        block setModel( level.crateModelFriendly );    
        block.angles = angle;
        wait 0.01;
}

It's works like this
  Reply
#5
pls use code tags
  Reply
#6
Thank you, works now
  Reply
#7
(12-26-2010, 03:38)master131 Wrote: *facepalm*
Code:
self CreateBlocks(self.origin, self getPlayerAngles());

((self getPlayerAngles()) is not a valid vector....

((123,456,789));

dude it takes a 3 dimensional vector array, thats wat getPlayerAngles give. You just have to remove the if statement
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help Spawning carepackage helicopter -- DidUknowiPwn 4 3,674 11-08-2013, 08:18
Last Post: DidUknowiPwn
  Spawning Solid Models akillj 5 3,933 09-08-2013, 00:07
Last Post: akillj
  Chicken spawning possible? akillj 8 4,540 09-07-2013, 06:22
Last Post: ScHmIdTy56789
  [Request] ForgeMOD - Spawning Crates (MW3) Destroyer1834 8 5,398 11-23-2012, 14:56
Last Post: 99IRock
  [Release] Script AI Spawning! ingame d0h! 19 18,835 05-18-2012, 10:17
Last Post: Cyborgking
Rainbow [Tutorial] Proper FX,sound,fog,ambient editing and spawning Yamato 0 3,047 10-08-2011, 15:49
Last Post: Yamato
  spawning models Xzite 21 9,818 09-11-2011, 13:46
Last Post: Xzite
  [Release] Spawning Weapons iAegle 0 2,306 08-30-2011, 16:35
Last Post: iAegle
  Help Spawning Bots prisma 12 6,900 08-29-2011, 14:07
Last Post: prisma
  Help spawning objects and getting your location koil 7 3,921 08-09-2011, 23:05
Last Post: koil

Forum Jump:


Users browsing this thread: 1 Guest(s)