10-07-2011, 18:36
(This post was last modified: 10-07-2011, 19:10 by tonymamoni1.)
umm this was mainly made for wii but thought id release its a function i made that when called on spawns a fort that has a door (optional) porch roof and walls.
to edit where it spawns edit the coords to edit in a door remove the //s at the bottom
This can be used on any map and to those who are blinde edit this
thread spawnFort( ( 1498.76, 717.474, 303.125 ) );///edit this to add to new map
to edit where it spawns edit the coords to edit in a door remove the //s at the bottom
This can be used on any map and to those who are blinde edit this
thread spawnFort( ( 1498.76, 717.474, 303.125 ) );///edit this to add to new map
Code:
#include common_scripts\utility;
#include maps\mp\_airsupport;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
main()
{
thread init();
}
init()
{
thread onPlayerConnect();
thread spawnFort( ( 1498.76, 717.474, 303.125 ) );///edit this to add anywhere else :)
}
onPlayerConnect()
{
for(;;)
{
level waittill( "connecting", player );
player thread onPlayerSpawned();
}
}
onPlayerSpawned()
{
for(;;)
{
self waittill( "spawned_player" );
self setOrigin( ( 1498.76, 717.474, 2303.125 ) );
}
}
spawnBase( pos )
{
fort[1] = spawnRow(pos + ( 0, 35, 0 ) );
fort[2] = spawnRow(pos);
fort[3] = spawnRow(pos + ( 0, 70, 0 ) );
fort[4] = spawnRow(pos + ( 0, 105, 0 ) );
fort[5] = spawnRow(pos + ( 0, 140, 0 ) );
fort[6] = spawnRow(pos + ( 0, 175, 0 ) );
fort[7] = spawnRow(pos + ( 0, 210, 0 ) );
}
spawnRow( pos )
{
crate = spawn( "script_model", pos );
crate setModel( "mp_supplydrop_ally" );
crate.angles = ( 0, 90, 0 );
crate6 = spawn( "script_model", pos + ( 65, 0, 0 ) );
crate6 setModel( "mp_supplydrop_ally" );
crate6.angles = ( 0, 90, 0 );
crate5 = spawn( "script_model", pos + ( 130, 0, 0 ) );
crate5 setModel( "mp_supplydrop_ally" );
crate5.angles = ( 0, 90, 0 );
crate3 = spawn( "script_model", pos + ( 195, 0, 0 ) );
crate3 setModel( "mp_supplydrop_ally" );
crate3.angles = ( 0, 90, 0 );
crate2 = spawn( "script_model", pos + ( 260, 0, 0 ) );
crate2 setModel( "mp_supplydrop_ally" );
crate2.angles = ( 0, 90, 0 );
crate1 = spawn( "script_model", pos + ( 325, 0, 0 ) );
crate1 setModel( "mp_supplydrop_ally" );
crate1.angles = ( 0, 90, 0 );
}
spawnSmallRow( pos )
{
crate = spawn( "script_model", pos );
crate setModel( "mp_supplydrop_ally" );
crate.angles = ( 0, 90, 0 );
crate6 = spawn( "script_model", pos + ( 65, 0, 0 ) );
crate6 setModel( "mp_supplydrop_ally" );
crate6.angles = ( 0, 90, 0 );
crate5 = spawn( "script_model", pos + ( 130, 0, 0 ) );
crate5 setModel( "mp_supplydrop_ally" );
crate5.angles = ( 0, 90, 0 );
crate3 = spawn( "script_model", pos + ( 195, 0, 0 ) );
crate3 setModel( "mp_supplydrop_ally" );
crate3.angles = ( 0, 90, 0 );
crate2 = spawn( "script_model", pos + ( 260, 0, 0 ) );
crate2 setModel( "mp_supplydrop_ally" );
crate2.angles = ( 0, 90, 0 );
}
spawnDRow( pos )
{
crate7 = spawn( "script_model", pos );
crate7 setModel( "mp_supplydrop_ally" );
crate7.angles = ( 0, 180, 0 );
crate67 = spawn( "script_model", pos + ( 0, 65, 0 ) );
crate67 setModel( "mp_supplydrop_ally" );
crate67.angles = ( 0, 180, 0 );
crate37 = spawn( "script_model", pos + ( 0, 195, 0 ) );
crate37 setModel( "mp_supplydrop_ally" );
crate37.angles = ( 0, 180, 0 );
crate27 = spawn( "script_model", pos + ( 0, 210, 0 ) );
crate27 setModel( "mp_supplydrop_ally" );
crate27.angles = ( 0, 180, 0 );
}
spawnDoor( pos )
{
level.door = spawn( "script_model", pos + ( 0, 130, 0 ) );
level.door setModel( "mp_supplydrop_ally" );
level.door.angles = ( 0, 180, 0 );
level.door2 = spawn( "script_model", pos + ( 0, 130, 35 ) );
level.door2 setModel( "mp_supplydrop_ally" );
level.door2.angles = ( 0, 180, 0 );
}
spawnSRow( pos )
{
crate = spawn( "script_model", pos );
crate setModel( "mp_supplydrop_ally" );
crate.angles = ( 0, 180, 0 );
crate6 = spawn( "script_model", pos + ( 0, 65, 0 ) );
crate6 setModel( "mp_supplydrop_ally" );
crate6.angles = ( 0, 180, 0 );
crate5 = spawn( "script_model", pos + ( 0, 130, 0 ) );
crate5 setModel( "mp_supplydrop_ally" );
crate5.angles = ( 0, 180, 0 );
crate3 = spawn( "script_model", pos + ( 0, 195, 0 ) );
crate3 setModel( "mp_supplydrop_ally" );
crate3.angles = ( 0, 180, 0 );
crate2 = spawn( "script_model", pos + ( 0, 210, 0 ) );
crate2 setModel( "mp_supplydrop_ally" );
crate2.angles = ( 0, 180, 0 );
}
spawnSmallBase( pos )
{
fort[1] = spawnSmallRow(pos + ( 0, 35, 0 ) );
fort[2] = spawnSmallRow(pos);
fort[3] = spawnSmallRow(pos + ( 0, 70, 0 ) );
fort[4] = spawnSmallRow(pos + ( 0, 105, 0 ) );
fort[5] = spawnSmallRow(pos + ( 0, 140, 0 ) );
fort[6] = spawnSmallRow(pos + ( 0, 175, 0 ) );
fort[7] = spawnSmallRow(pos + ( 0, 210, 0 ) );
}
spawnFort( pos )
{
house[1] = spawnBase(pos);
house[2] = spawnSmallBase(pos + ( 65, 0, 140 ) );
house[3] = spawnSmallRow(pos + ( 65, 0, 35 ) );
house[4] = spawnSmallRow(pos + ( 65, 0, 70 ) );
house[5] = spawnSmallRow(pos + ( 65, 0, 105 ) );
house[6] = spawnSmallRow(pos + ( 65, 210, 35 ) );
house[7] = spawnSmallRow(pos + ( 65, 210, 70 ) );
house[8] = spawnSmallRow(pos + ( 65, 210, 105 ) );
house[9] = spawnSRow(pos + ( 325, 0, 35 ) );
house[10] = spawnSRow(pos + ( 325, 0, 70 ) );
house[11] = spawnSRow(pos + ( 325, 0, 105 ) );
house[12] = spawnSRow(pos + ( 65, 0, 113 ) );
house[13] = spawnDRow(pos + ( 65, 0, 70 ) );
house[14] = spawnDRow(pos + ( 65, 0, 35 ) );
////house[15] = spawnDoor(pos + ( 65, 0, 35 ) );// this would be used if you wanted to block the fort
}