Author |
Topic: how do i make a cod4 custom map use certain weapons |
Pinball |
|
General Member Since: Jun 19, 2005 Posts: 61 Last: Jul 18, 2017 [view latest posts] |
|
|
|
|
|
Pinball |
|
General Member Since: Jun 19, 2005 Posts: 61 Last: Jul 18, 2017 [view latest posts] |
|
|
|
.KiLL3R. |
|
General Member Since: Oct 26, 2006 Posts: 1437 Last: Jul 3, 2017 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Sunday, Jul. 2, 2017 06:34 pm |
|
This map script should do the trick, not tested though.
Code:
main()
{
// usual map stuff
thread onPlayerConnect();
}
onPlayerConnect()
{
while(1)
{
level waittill("connected", player);
player thread onPlayerSpawn();
}
}
onPlayerSpawn()
{
self endon("disconnect");
while(1)
{
self waittill("spawn");
wait 0.05; // Wait for game spawn scripts to do their thing
if(self.sessionstate == "playing") // Make sure we're still alive
{
self takeAllWeapons();
self giveWeapon("shotgun_mp");
self giveWeapon("handgun_mp");
}
}
}
Change shotgun_mp and handgun_mp to the weapons you want to give the player. |
|
|
|
Pinball |
|
General Member Since: Jun 19, 2005 Posts: 61 Last: Jul 18, 2017 [view latest posts] |
|
|
|
.KiLL3R. |
|
General Member Since: Oct 26, 2006 Posts: 1437 Last: Jul 3, 2017 [view latest posts] |
|
|
|
Pinball |
|
General Member Since: Jun 19, 2005 Posts: 61 Last: Jul 18, 2017 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Monday, Jul. 3, 2017 04:06 am |
|
Is this right? I did what you said and it's not working.
----------------------
main()
{
//maps\mp\mp_backlot_fx::main();
//maps\createart\mp_backlot_art::main();
maps\mp\_load::main();
//maps\mp\_compass::setupMiniMap("compass_map_mp_arc_arena");
//setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
VisionSetNaked( "mp_small_lot" );
ambientPlay("ambient_backlot_ext");
game["allies"] = "marines";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert";
game["axis_soldiertype"] = "desert";
setdvar( "r_specularcolorscale", "1" );
setdvar("r_glowbloomintensity0",".25");
setdvar("r_glowbloomintensity1",".25");
setdvar("r_glowskybleedintensity0",".3");
setdvar("compassmaxrange","1800");
thread onPlayerConnect();
}
onPlayerConnect()
{
while(1)
{
level waittill("connected", player);
player thread onPlayerSpawn();
}
}
onPlayerSpawn()
{
self endon("disconnect");
while(1)
{
self waittill("spawn");
wait 0.05; // Wait for game spawn scripts to do their thing
if(self.sessionstate == "playing") // Make sure we're still alive
{
self takeAllWeapons();
self giveWeapon("m1014_mp");
self giveWeapon("deserteagle_mp");
}
}
} |
|
|
|
.KiLL3R. |
|
General Member Since: Oct 26, 2006 Posts: 1437 Last: Jul 3, 2017 [view latest posts] |
|
|
Category: CoD4 MP Mapping Posted: Monday, Jul. 3, 2017 10:55 am |
|
Oops, I used "spawn" instead of "spawned", this should do it:
Code:
main()
{
//maps\mp\mp_backlot_fx::main();
//maps\createart\mp_backlot_art::main();
maps\mp\_load::main();
//maps\mp\_compass::setupMiniMap("compass_map_mp_arc_arena");
//setExpFog(500, 2200, 0.81, 0.75, 0.63, 0);
VisionSetNaked( "mp_small_lot" );
ambientPlay("ambient_backlot_ext");
game["allies"] = "marines";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert";
game["axis_soldiertype"] = "desert";
setdvar( "r_specularcolorscale", "1" );
setdvar("r_glowbloomintensity0",".25");
setdvar("r_glowbloomintensity1",".25");
setdvar("r_glowskybleedintensity0",".3");
setdvar("compassmaxrange","1800");
thread onPlayerConnect();
}
onPlayerConnect()
{
while(1)
{
level waittill("connected", player);
player thread onPlayerSpawn();
}
}
onPlayerSpawn()
{
self endon("disconnect");
while(1)
{
self waittill("spawn");
wait 0.05; // Wait for game spawn scripts to do their thing
if(self.sessionstate == "playing") // Make sure we're still alive
{
self takeAllWeapons();
self giveWeapon("m1014_mp");
self giveWeapon("deserteagle_mp");
}
}
}
|
|
|
|
Pinball |
|
General Member Since: Jun 19, 2005 Posts: 61 Last: Jul 18, 2017 [view latest posts] |
|
|
|
Pinball |
|
General Member Since: Jun 19, 2005 Posts: 61 Last: Jul 18, 2017 [view latest posts] |
|
|
|