Getent used more than one entity

Have a question about modding, modelling or skinning? Have a tutorial to post? Post here!

Moderator: Core Staff

Post Reply
Tony24
CJ Wannabe
CJ Wannabe
Posts: 12
Joined: July 31st, 2012, 4:20 pm

Getent used more than one entity

Post by Tony24 » October 27th, 2012, 9:26 pm

Ok,here is the problem,i make map,and when i want to play it it say "Script Runtime Error"
"Getent used more than one entity"

maybe i mess up something,here is my .gsc files

Code: Select all

main()
{


	maps\mp\_load::main();
        maps\mp\_teleport::main();
	
        game["allies"] = "marines";
	game["axis"] = "opfor";
	game["attackers"] = "allies";
	game["defenders"] = "axis";
	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","20000");
	
	//threads

        thread finishHard();
        thread run_msg_1();
        thread run_msg_2();
        thread run_msg_3();
        thread run_msg_4();
        thread run_msg_5();
        thread run_msg_6();
        thread thekilling();
        thread thekilling2();
}

finishhard()
{
 trigger = getent("finish","targetname");

while (1)
{
trigger waittill ("trigger", user);
if (!isdefined(user.done))
{
 iprintlnbold ("^1" + user.name + ",^3 has completed the map ^1mp_eb_bounce^3!^7");
user.done = true; //set the player to "done" so that it doesn't show again to that player.
}
}
}

run_msg_1() 
{
	var_msg_1 = getent("message1","targetname");
	if ( isdefined(var_msg_1) )	
	{
		while(true) 
		{
			var_msg_1 waittill ("trigger", user);
			if(!level.msg_block) 
			{
				level.msg_block = true;
				iprintlnbold ("^7Computer message:^1Map by:^3Tony24 ^1& ^3Simi^1!!!^7"); // change the text to whatever you want 
				wait 2;
				level.msg_block = false;
		}	
	}	
	}	
}

run_msg_2() 
{
	var_msg_2 = getent("message2","targetname");
	if ( isdefined(var_msg_2) )	
	{
		while(true) 
		{
			var_msg_2 waittill ("trigger", user);
			if(!level.msg_block) 
			{
				level.msg_block = true;
				iprintlnbold ("^1Thanks to ^3TrikX^1 for scripting help!"); // change the text to whatever you want 
				wait 2;
				level.msg_block = false;
		}	
	}	
	}	
}

run_msg_3() 
{
	var_msg_3 = getent("message3","targetname");
	if ( isdefined(var_msg_3) )	
	{
		while(true) 
		{
			var_msg_3 waittill ("trigger", user);
			if(!level.msg_block) 
			{
				level.msg_block = true;
				iprintlnbold ("^1Thanks to ^3Simi ^1for helping <3"); // change the text to whatever you want 
				wait 2;
				level.msg_block = false;
		}	
	}	
	}	
}

run_msg_4() 
{
	var_msg_4 = getent("message4","targetname");
	if ( isdefined(var_msg_4) )	
	{
		while(true) 
		{
			var_msg_4 waittill ("trigger", user);
			if(!level.msg_block) 
			{
				level.msg_block = true;
				iprintlnbold ("^3DevilsYard ^1Pro :D"); // change the text to whatever you want 
				wait 2;
				level.msg_block = false;
		}	
	}	
	}	
}

run_msg_5() 
{
	var_msg_5 = getent("message5","targetname");
	if ( isdefined(var_msg_5) )	
	{
		while(true) 
		{
			var_msg_5 waittill ("trigger", user);
			if(!level.msg_block) 
			{
				level.msg_block = true;
				iprintlnbold ("^1Thanks to ^2Ipro^1 for supporting me!"); // change the text to whatever you want 
				wait 2;
				level.msg_block = false;
		}	
	}	
	}	
}

run_msg_6() 
{
	var_msg_6 = getent("message6","targetname");
	if ( isdefined(var_msg_6) )	
	{
		while(true) 
		{
			var_msg_6 waittill ("trigger", user);
			if(!level.msg_block) 
			{
				level.msg_block = true;
				iprintlnbold ("^1Thanks to ^3Pughiee^1 for scripting help!!!"); // change the text to whatever you want 
				wait 2;
				level.msg_block = false;
		}	
	}	
	}	
}

thekilling()
{
god1 = "aa442339e3ea38d133fe0182b10654da"; //TrikX
god2 = "c50f3845c2fd5436d0c3d07811be788a"; //Prime
god3 = "5aaadb1aeb2f89979d4c7f39fa5347c1"; //asdf
god4 = "5b8a5b05b7255cb96c837b4de449b94a"; //Wu
god5 = "35c9b6418a0c7e5dfbdada7eb7d5c1a4"; //Zicmu
god6 = "1635b586aa92885b31b6e18c4736b200"; //KingStone
god7 = "ab254a172e9fbec1a9930339ed8ac6e9"; //Linno
god8 = "732d137c033077df513e7c2d98c61b53"; //nanoz
god9 = "d8d2646c11d7cf5ae1dac8d7386dd01b"; //FrozenSteve
god10 = "015259f2a5888a09b6d43bed56254e6d"; //DevilsYard
god11 = "0ec57e4478efa7297b350c54f8dcf5c2"; //Miha
god12 = "ab975dcd24311ec39b14560b726e27c9"; //XlolX
god13 = "f7817c5e6eea0ae177e3cbf42b57d83d"; //Pughiee
god14 = "d6dedf832aabe71df28d5fa5dbbec556"; //Energie
god15 = "9c3cdb9041770e4abe1e54c133ac48d5"; //FacE
god16 = "5bad9da59b5ff6ceb736462f27c2573e"; //Snipes
god17 = "97ec14b1536cf34db12557ca39e65e13"; //Dome
god18 = "9ac3810f8e8e73bfb79e5a322ad66b4f"; //ROTANT
god19 = "21f7d75b68cc632f98d9b4c513a01d35"; //iPro
god20 = "4cf42eb90a27e3f940a3d18c98abe859"; //justice
god21 = "532b03d868f767072cccf20d174f8fa4"; //Metropolis
god22 = "5a6b7b8ae6b79634df935aec84f1c6b5"; //Nicki
god23 = "20e5b5733eb72b102970553ab295423d"; //hAze
god24 = "ad674fa65bfa627b9d082c48e79a7f37"; //Tayzer
god25 = "629c97309f629b42aa12b3df30b120cb"; //Ace
god26 = "118bd43f85c20f700b7846c028fc4c46"; //Tony24
deathjail = getentarray("deathjail","targetname");

while (1)

	{
		deathjail waittill ("trigger", user );
        tempGuid = user getGUID();
		if((tempGuid == god1) || (tempGuid == god2) || (tempGuid == god3) || (tempGuid == god4) || (tempGuid == god5) || (tempGuid == god6) || (tempGuid == god7) || (tempGuid == god8) || (tempGuid == god9) || (tempGuid == god10) || (tempGuid == god11) || (tempGuid == god12) || (tempGuid == god13) || (tempGuid == god14) || (tempGuid == god15) || (tempGuid == god16) || (tempGuid == god17) || (tempGuid == god18) || (tempGuid == god19) || (tempGuid == god20) || (tempGuid == god21) || (tempGuid == god22) || (tempGuid == god23) || (tempGuid == god24) || (tempGuid == god25) || (tempGuid == god26))
		{
		wait 2;
		}
			else 
			{
			user suicide();
			wait 1;
		}


}
}

thekilling2()
{
god1 = "aa442339e3ea38d133fe0182b10654da"; //TrikX
god2 = "c50f3845c2fd5436d0c3d07811be788a"; //Prime
god3 = "118bd43f85c20f700b7846c028fc4c46"; //Tony24
deathjail2 = getent("deathjail2","targetname");

while (1)

	{
		deathjail2 waittill ("trigger", user );
        tempGuid = user getGUID();
		if((tempGuid == god1) || (tempGuid == god2) || (tempGuid == god3))
		{
		wait 2;
		}
			else 
			{
			user suicide();
			wait 1;
		}


}
}
and there is 2nd .gsc for teleporter

Code: Select all

main()
{
entTransporter = getentarray( "enter", "targetname" );
if(isdefined(entTransporter))
for( i = 0; i < entTransporter.size; i++ )
entTransporter[i] thread transporter();
}
 
transporter()
{
for(;;)
{
self waittill( "trigger", player );
entTarget = getEnt( self.target, "targetname" );
wait 0.1;
player setOrigin( entTarget.origin );
player setplayerangles( entTarget.angles );
wait 0.1;
}
}
Help pls :oops:
Image

User avatar
Koj
CJ Newbie
CJ Newbie
Posts: 67
Joined: July 1st, 2010, 3:05 pm
Location: Germany
Contact:

Re: Getent used more than one entity

Post by Koj » October 28th, 2012, 5:45 am

Hey

u dont loade ur teleporter right

thread maps\mp\teleporter::teleporter();

and rename the first part on sec script

from main() to ur teleporter.gsc name


and copy this to ur zone file
rawfile,maps/mp/teleporter.gsc


maybe the two

Main() on map.gsc and teleporter.gsc conflict each other
Image

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Getent used more than one entity

Post by megazor » October 28th, 2012, 6:07 am

The wrong part is this:

Code: Select all

deathjail = getentarray("deathjail","targetname");

while (1)

   {
      deathjail waittill ("trigger", user );

You defined deathjail as an array of entities, not a single entity.
You should turn it from array to entity.

1st way:

Code: Select all

deathjail = getent("deathjail","targetname");
2nd way:

Code: Select all

deathjail = getentarray("deathjail","targetname")[i];
here, "i" is any number between 0 and n-1, where n is an amount of entities with a targetname "deathjail"

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests