Sign in to follow this  
Followers 0
Shield

Error at loading the map

6 posts in this topic

Hey,

 

i have tested to run my map. At the first test all run ok, but at every contact with a trigger i got a script compile error like undefined object, cant load main, etc.

 

at the 2 try the map cant be loaded more.. there come this error : 

 

post-406-0-75613800-1437828164.png

 

post-406-0-29252100-1437828138.png

 

and here is my script:

main()
{
maps\mp\_load::main();
 	
game["allies"] = "marines";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert";
game["axis_soldiertype"] = "desert";


//Waffen hinzufügen
PreChacheItem ("weapon_g3_grenadier");
PreCacheItem ("weapon_ak74u_reflex_mp");
PreCacheItem ("weapon_brick_blaster_mp");

//start
thread start();
thread weapon();
thread weapon1();
thread weapon2();
thread startdoor();


}

start()
{
trigger = getEnt ("weap","targetname");
object = getEnt ("weap1","targetname");
trigger waittill ("trigger",player);
wait(3);
object moveZ (150,4);
}

weapon()
{
trig = getEnt ("g3","targetname");
for(;;)
{
trig waittill ("trigger",player);
player GiveWeapon ("weapon_g3_grenadier");
player switchtoWeapon ("weapon_g3_grenadier");
player IprintLnBold ("You got the Amazing ^3G3!");
}
}



weapon1()
{
trig = getEnt ("ak","targetname");
for(;;)
{
trig waittill ("trigger",player);
player GiveWeapon ("weapon_ak74u_reflex_mp");
player switchtoWeapon ("weapon_ak74u_reflex_mp");
player IprintLnBold ("You got this hot ^4ak74, ^5Have fun with it :D");
}
}


weapon2()
{
trig = getEnt ("brick","targetname");
for(;;)
{
trig waittill ("trigger",player);
player GiveWeapon ("weapon_brick_blaster_mp");
player switchtoWeapon ("weapon_brick_blaster_mp");
player IprintLnBold ("^2Brick Blaster? ^4WTF!!! ^5Hahaha :D");
}
}

startdoor()
{
object = getEnt ("door","targetname");
wait(10);
IprintLnBold ("Welcome to my first map Shield");
wait(5);
IprintLnBold ("Map by Shield");
wait(3);
IprintLnBold ("Have fun and enjoy it");
wait(3);
object moveZ (150,3);
}

and when i like to press the use touch trigger to get a weap there come a script compile error (undefined object) .

 

I dont know why this dont works...

 

I hope you can help me there.

 

Shield

0

Share this post


Link to post
Share on other sites

Yes i asked me too why this error was coming... when nothing is on this line.. 

 

but i fixed it. i forgot at startdoor after moveZ , the waittill ("movedone") now the most works.

 

but question to the weaponselection. 

 

I have this script there : 

weapon()
{
trig = getEnt ("g3","targetname");
for(;;)
{
trig waittill ("trigger",player);
wait 0.5;
player giveWeapon ("plasma_mp");
player switchToWeapon ("plasma_mp");
player giveMaxAmmo ("plasma_mp");
wait 0.5;
player IprintLnBold ("You got the Amazing ^3Plasmagun!");
}
}



weapon1()
{
trig = getEnt ("ak","targetname");
for(;;)
{
trig waittill ("trigger",player);
wait 0.5;
player giveWeapon ("deserteagle_mp");
player switchToWeapon ("deserteagle_mp");
player giveMaxAmmo ("deserteagle_mp");
wait 0.5;
player IprintLnBold ("You got this hot ^3deserteagle, ^5Have fun with it :D");
}
}


weapon2()
{
trig = getEnt ("brick","targetname");
for(;;)
{
trig waittill ("trigger",player);
wait 0.5;
player giveWeapon ("portal_mp");
player switchToWeapon ("portal_mp");
player giveMaxAmmo ("portal_mp");
wait 0.5;
player IprintLnBold ("^4WTF!!! ^5Hahaha :D");
}
}

Only at weapon1() i get a weapon. 

and at weapon and weapon 2 its only print... and i dont get this weapon. 

Are there some weapons which i cant get or ?

0

Share this post


Link to post
Share on other sites

Learn to indent

I'll take a look at the script when's it's properly formatted

0

Share this post


Link to post
Share on other sites

Weapon1 is giving you something that is already in cod4, the desert eagle

Whereas Weapon & Weapon2 are trying to give you custom weapons, which is where you must of made a mistake, you are going to need to fix the weapons

 

Also @Sentrex, when putting the script onto [code ] it doesn't show the correct identation, shown here: http://i.gyazo.com/fe8e1f0c95d2c4ebc01312b2c1d4a9b0.png, On notepad++ it shows correctly formatted however on the forums it doesn't

0

Share this post


Link to post
Share on other sites
onSpawn()
{
	level waittill( "round_started" );
	players = getAllPlayers();
	for( i = 0 ; i < players.size ; i++ )
	{
		players[i].hasController = false;
	}
}

Seems fine to me?

1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  
Followers 0