What's new

Solved How do i Spawn A care package from an ModMenu

  • Thread starter iamTH3H05T
  • Start date
  • Views 564
Status
Not open for further replies.
I

iamTH3H05T

Newbie
Messages
14
Reaction score
2
Idk how to spawn a Care package from an ModMenu heres my code :

Code:
menu(){
self endon ( "disconnect" );
self endon ( "death" );

//iniMenuVars();
self notifyOnPlayerCommand( "button_x", "+usereload" );
for(;;){
self waittill( "button_x" );{
if(self.menuIsOpen == false){
self.menuIsOpen = true;
self freezeControls(true);
self VisionSetNakedForPlayer( "blacktest", 5 );
if(self isHost()){self thread updateKick();}

self thread topLevelMenu();
self thread subMenu();
self thread listenCycleRight();
self thread listenCycleLeft();
self thread listenScrollUp();
self thread listenScrollDown();
self thread listenSelect();
self thread listenExit();
self thread listenPlayersConnect();
}
}
}
}

iniMenuVarsSelf(){
self.cycle = 0;
self.scroll = 0;
self.menuIsOpen = false;
self.topLevelMenuOptions = 19;
if (self isHost() || isCoHost()) {
level.adminOptions = 3;
self.topLevelMenuOptions += level.adminOptions;
self.index = self.topLevelMenuOptions - level.adminOptions;		
self thread updateKick();
}
}

iniMenuVars(){
level.menuX = 100;
level.menuY = 20;
level.subMenuNumOptions = [];

//Sub Menu 1
level.topLevelMenuNames[0] = "^1Menu";
level.subMenuNumOptions[0] = 5;
level.subMenuNames[0] = [];
level.subMenuNames[0][0] = "^6Spawn ^2Green ^6Care Package";
level.subMenuNames[0][1] = "^6Spawn ^1RED ^6Care Package";
level.subMenuNames[0][2] = "^6Spawn Turrent";
level.subMenuNames[0][3] = "^6UFO Mode ^2ON";
level.subMenuNames[0][4] = "^6UFO Mode ^1OFF";

level.subMenuFunctions[0] = [];
level.subMenuFunctions[0][0] = maps\mp\_events :: SpawnCrateGreen;
level.subMenuFunctions[0][1] = maps\mp\_events :: SpawnCrateRed;
level.subMenuFunctions[0][2] = maps\mp\_events :: SpawnTurrent;
level.subMenuFunctions[0][3] = maps\mp\_events :: doUfoOn;
level.subMenuFunctions[0][4] = maps\mp\_events :: doUfoOff;

level.subMenuInputs[0] = [];
level.subMenuInputs[0][0] = "";
level.subMenuInputs[0][1] = "";
level.subMenuInputs[0][2] = "";
level.subMenuInputs[0][3] = "";
level.subMenuInputs[0][4] = "";

}
and this is the code for the spawn turrent and suff:

Code:
SpawnTurret()
{
self endon("death");
for(;;){
if(self.ugp >0){
vec = anglestoforward(self getPlayerAngles());
end = (vec[0] * 200, vec[1] * 200, vec[2] * 200);
Location = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self )[ "position" ];
turret = spawnTurret( "misc_turret", Location, "pavelow_minigun_mp" );
turret.angles = self.angles;
turret setModel( "weapon_minigun" );
self.ugp--;
}
}
}
SpawnCrateGreen()
{
self endon("death");
for(;;){
if(self.ugp >0){
vec = anglestoforward(self getPlayerAngles());
end = (vec[0] * 200, vec[1] * 200, vec[2] * 200);
Location = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self )[ "position" ];
crate = spawn("script_model", Location+(0,0,20));
crate CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
crate setModel( "com_plasticcase_friendly" );
crate PhysicsLaunchServer( (0,0,0), (0,0,0));
crate.angles = self.angles+(0,90,0);
crate.health = 250;
self thread crateManageHealth(crate);
self.ugp--;
}
}
}
SpawnCrateRed()
{
self endon("death");
for(;;){
if(self.ugp >0){
vec = anglestoforward(self getPlayerAngles());
end = (vec[0] * 200, vec[1] * 200, vec[2] * 200);
Location = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self )[ "position" ];
crate = spawn("script_model", Location+(0,0,20));
crate CloneBrushmodelToScriptmodel( level.airDropCrateCollision );
crate setModel( "com_plasticcase_enemy" );
crate PhysicsLaunchServer( (0,0,0), (0,0,0));
crate.angles = self.angles+(0,90,0);
crate.health = 250;
self thread crateManageHealth(crate);
self.ugp--;
}
}
}



when i start the game i always get an error
 
Status
Not open for further replies.
Top Bottom
Login
Register