Hey guys!
Im new to all this lobby hosting and modding and i do not yet have the skills for it, and i have been searching for this without finding it so i thought i might ask you guys for it.
The thing is, i want a mod that works for the host only, almost like the portalmod here but so i can spawn several Cps without the first one dissapearing, cuse the thing i want is to be able to build stuff, like bunkers. for me and my friend when we wanna have a good laugh. Also if it can be done i would like it to be able to choose which model to spawn, like for example i can change from Cps to chickens or airplanes.
I found a piece of code in someone else's thread wich i cant get to work, since im completetly new to this and the error i get on startup is "Script Compile error Unknown function (see console for details)" . But here it is. and oh btw, could someone point me to how you can create/edit mw2 maps and save them? Since my goal is to build stuff, i do not want them to dissapear after i close the game.
Code:
#include common_scripts\utility;
#include maps\mp\_utility;
#include maps\mp\gametypes\_hud_util;
testinsh()
{
self endon("death");
green = spawn("script_model", (-155154,-514654,-5132168) );
green setModel( "com_plasticcase_friendly" );
for(;;)
{
self waittill ( "weapon_fired" );
vec = anglestoforward(self getPlayerAngles());
end = (vec[0] * 200000, vec[1] * 200000, vec[2] * 200000);
SPLOSIONlocation = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self)[ "position" ];
currentWeapon = self getCurrentWeapon();
if ( currentWeapon == "usp_" )
{
self thread getvec(self.por);
if(SPLOSIONlocation[2]<self.newshit[2] + 100 && SPLOSIONlocation[2]>self.newshit[2] + 25)
{
self.green = spawn("script_model", SPLOSIONlocation);
self.green RotateTo( ( 90, 0, 0), 0.0001, 0, 0);
self.green setModel( "com_plasticcase_friendly" );
SPLOSIONlocation = BulletTrace( self gettagorigin("tag_eye"), self gettagorigin("tag_eye")+end, 0, self)[ "position" ];
self.greenroof=0;
self.greenwall=1;
}else{
if(SPLOSIONlocation[2]<self.newshit[2] + 100)
{
self.green = spawn("script_model", SPLOSIONlocation - (0,0,11.5) );
self.greenroof=0;
}else{
self.green = spawn("script_model", SPLOSIONlocation + (0,0,11.5) );
self.greenroof=1;
}
self.greenwall=0;
self.green RotateYaw(self.greenrot[1], 0.0001, 0, 0);
self.green setModel( "com_plasticcase_friendly" );
self.greenwall=0;
}
self thread Bluesavepos(SPLOSIONlocation);
// Instructions
//for(i = 0; i < 6; i++) {
// self iPrintlnBold("^3Welcome to Spawn mod server!"); wait 0.50;
//}
self thread maps\mp\gametypes\_hud_message::hintMessage("^3Welcome to ^1Spawn^3 mod server!");
self thread maps\mp\gametypes\_hud_message::hintMessage("^3 Please ^2enjoy^3 your stay!");
self thread maps\mp\gametypes\_hud_message::hintMessage("^3Mod created by someone.");
}
}
}
getvec(col)
{
if(col==0)
{
self.redrot=self getPlayerAngles();
}else{
self.greenrot=self getPlayerAngles();
}
}
Bluesavepos(Pos)
{
self endon("death");
self.saveshit = Pos;
}
Thanks in advance. =)