[help] Shooting solid crates

Posts 1–7 of 7 · Page 1 of 1
[help] Shooting solid crates
I have the following code to shoot crates, but somehow there not solid (so u cant use it as baricade):

Code:
SpawnCrate()
{
	self endon("death");
        for(;;)
        {
                self waittill ( "weapon_fired" );
                vec = anglestoforward(self getPlayerAngles());
                SPLOSIONlocation = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+(vec[0] * 2000, vec[1] * 2000, vec[2] * 2000), 0, self)[ "position" ];
                obj = spawn("script_model", self gettagorigin("tag_eye"));
                obj setModel( "com_plasticcase_friendly" );
		obj CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
		obj Solid();
                obj moveto(SPLOSIONlocation, distance(self gettagorigin("tag_eye"), SPLOSIONlocation)/1200);
                obj.angles = self getplayerangles();
		obj.health = 250;
                self thread ObjManageHealth(obj);                
			
		
	}
}

ObjManageHealth(obj)
{
	for(;;){
		obj setcandamage(true);
		obj.team = self.team;
		obj.owner = self.owner;
		obj.pers["team"] = self.team;
		if(obj.health < 0){
			level.chopper_fx["smoke"]["trail"] = loadfx ("fire/fire_smoke_trail_L");
			playfx(level.chopper_fx["smoke"]["trail"], obj.origin);
			obj delete();
			}
		wait 0.1;
		}
}
What did i do wrong ?
Quote Originally Posted by kerocs View Post
I have the following code to shoot crates, but somehow there not solid (so u cant use it as baricade):

Code:
SpawnCrate()
{
	self endon("death");
        for(;;)
        {
                self waittill ( "weapon_fired" );
                vec = anglestoforward(self getPlayerAngles());
                SPLOSIONlocation = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+(vec[0] * 2000, vec[1] * 2000, vec[2] * 2000), 0, self)[ "position" ];
                obj = spawn("script_model", self gettagorigin("tag_eye"));
                obj setModel( "com_plasticcase_friendly" );
		obj CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
		obj Solid();
                obj moveto(SPLOSIONlocation, distance(self gettagorigin("tag_eye"), SPLOSIONlocation)/1200);
                obj.angles = self getplayerangles();
		obj.health = 250;
                self thread ObjManageHealth(obj);                
			
		
	}
}

ObjManageHealth(obj)
{
	for(;;){
		obj setcandamage(true);
		obj.team = self.team;
		obj.owner = self.owner;
		obj.pers["team"] = self.team;
		if(obj.health < 0){
			level.chopper_fx["smoke"]["trail"] = loadfx ("fire/fire_smoke_trail_L");
			playfx(level.chopper_fx["smoke"]["trail"], obj.origin);
			obj delete();
			}
		wait 0.1;
		}
}
What did i do wrong ?
that will fail so hard because it will lag a lot...or make the code heavy and crash.
nope it wont lagg cause ill limit the amount of cps one has per respawn and i make only usps spawn the cps. So u cant answer my question ?
Quote Originally Posted by kerocs View Post
nope it wont lagg cause ill limit the amount of cps one has per respawn and i make only usps spawn the cps. So u cant answer my question ?
y dont you just get spawn mod i would put attachment but idk how
hmmm i couldnt find spawn mod do the spawned carepackages block in that mod ? I made it work but they dont block ...
Quote Originally Posted by tank2800 View Post
y dont you just get spawn mod i would put attachment but idk how
go to advanced options when posting then scroll down to additional options click manage attachments then attach it make sure it is in a rar file and dont forget virus scans so it can be apporved. youll probly get told to make a new thread for it
Quote Originally Posted by khcastro View Post


go to advanced options when posting then scroll down to additional options click manage attachments then attach it make sure it is in a rar file and dont forget virus scans so it can be apporved. youll probly get told to make a new thread for it
All Major Attachments must be represented in their own separate thread.
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us