ItsMods

Full Version: Spawning a crate
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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)
because ur map functions are jacked up lol remove the if statement line
*facepalm*
Code:
self CreateBlocks(self.origin, self getPlayerAngles());

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

((123,456,789));
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
pls use code tags
Thank you, works now
(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