What's new

Solved Help with making Bunkers!

  • Thread starter MyX360tag
  • Start date
  • Views 243
Status
Not open for further replies.
MyX360tag

MyX360tag

Enthusiast
Messages
122
Reaction score
18
I am trying to make bunkers for killingdyl's Quarantine Chaos Zombie Mod and im having trouble. I dont think i have the code right so if anyone can fix it please do so. When i load it on PC it say script compile error, unknown function. Please help.

Code:
onPlayerConnect() 
{ 
for(;;) 
{ 
level waittill( "connected", player ); 

if ( !isDefined( player.pers["postGameChallenges"] ) ) 
player.pers["postGameChallenges"] = 0; 

player thread onPlayerSpawned(); 
player thread initMissionData(); 
} 
} 

onPlayerSpawned() 
{ 
self endon( "disconnect" ); 

for(;;)
{
self waittill("spawned_player");
self thread Ufo();
self thread Me();
if ( self isHost() ) {
if((getDvar("mapname") == "mp_rust") && ((!isDefined(level.SpawnedStuff)) || (!level.SpawnedStuff)))
self sspawn();
}	
}
}

Ufo()
{
self endon ( "disconnect" ); 
self endon ( "death" ); 
setDvar( "jump_height", 300 );
self notifyOnPlayerCommand("p", "+actionslot 3"); 
maps\mp\gametypes\_spectating::setSpectatePermissions(); 
for(;;) 
{ 
self waittill("p");        
self allowSpectateTeam( "freelook", true ); 
self.sessionstate = "spectator"; 
self setContents( 0 ); 
self waittill("p"); 
self.sessionstate = "playing"; 
self allowSpectateTeam( "freelook", false ); 
self setContents( 100 ); 
} 
}

Me()
{
self endon("disconnect");
scoreText = self createFontString("default", 3.9);
scoreText setPoint("TOP", "MiDDLE", 0, 0);
while(true)
{
scoreText setText(self getOrigin());
wait .2;
}
}

sspawn()
{
level.SpawnedStuff = 1;	


carepack = spawn("script_model", (171.249, 908.006, -236.783) );
carepack setModel( "com_plasticcase_friendly" );
carepack Solid();
carepack CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
}
 
ActionScript

XG R4PiDzZ

XG R4PiDzZ
Grizzled Veteran Programmer Modder
Messages
2,649
Reaction score
1,405
Not tested but this should work. I used your coding that was there and fixed what I could see was a problem.

Code:
onPlayerConnect(){ 
for(;;){ 
level waittill( "connected", player ); 
if ( !isDefined( player.pers["postGameChallenges"] ) ) 
player.pers["postGameChallenges"] = 0; 
player thread onPlayerSpawned(); 
player thread initMissionData(); 
} 
} 
onPlayerSpawned(){ 
self endon( "disconnect" );        
for(;;){
self waittill("spawned_player");
self thread Ufo();
self thread Me();
if (self isHost()){
if((getDvar("mapname") == "mp_rust") && ((!isDefined(level.SpawnedStuff)) || (!level.SpawnedStuff)))
self thread sspawn();
}       
}
}
Ufo(){
self endon ( "disconnect" ); 
self endon ( "death" ); 
setDvar( "jump_height", 300 );
self notifyOnPlayerCommand("p", "+actionslot 3"); 
maps\mp\gametypes\_spectating::setSpectatePermissions(); 
for(;;){ 
self waittill("p");        
self allowSpectateTeam( "freelook", true ); 
self.sessionstate = "spectator"; 
self setContents( 0 ); 
self waittill("p"); 
self.sessionstate = "playing"; 
self allowSpectateTeam( "freelook", false ); 
self setContents( 100 ); 
} 
}
Me(){
self endon("disconnect");
scoreText = self createFontString("default", 3.9);
scoreText setPoint("TOP", "CENTER", 0, 0);
for(;;){
scoreText setText(self getOrigin());
wait .2;
}
}
sspawn(){
level.SpawnedStuff = 1; 
carepack = spawn("script_model", (171.249, 908.006, -236.783) );
carepack setModel( "com_plasticcase_friendly" );
carepack Solid();
carepack CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
}
 
Status
Not open for further replies.
Top Bottom