Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds
Watch MODSonair

Members Online

»
1 Active | 35 Guests
Online:

LATEST FORUM THREADS

»
Call of DutyŽ: WWII
CoD WW2 General
SOF2 Prefabs map
SoFII Mapping
coduo mapping tools
CoDUO Mapping

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty
Category: CoDUO Mapping
CoD United Offensive mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: random teleport locations
BA_GomerPyle
General Member
Since: Jul 26, 2012
Posts: 44
Last: May 18, 2019
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Monday, Oct. 15, 2012 01:37 pm
Would it be possible to change this script so a player is transported to random locations? For instance.

Could the line entTarget = getent(self.target, "targetname");
be changed to entTarget = getentarray(self.target, "targetname");

and would it work in multiplayer?

[ohwell]

main()
{

entTransporter = getentarray("enter","targetname");
if(isdefined(entTransporter)) {
for(lp=0 ; lp < entTransporter.size ; lp++) {
entTransporter[lp] thread Transporter();
}
}

}


Transporter()
{
while(true)
{
self waittill("trigger",other);
entTarget = getent(self.target, "targetname");

wait(0.10);
other setorigin(entTarget.origin);
other setplayerangles(entTarget.angles);
//iprintlnbold ("You have been teleported !!!");
wait(0.10);
}
}
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoDUO Mapping
Posted: Tuesday, Oct. 16, 2012 03:00 am
teleports you to different "target" positions:
Code:
main()
{
	level.transporter_entries = getEntArray( "enter" , "targetname" );
	level.transporters_targets = getEntArray( "target" , "targetname" );

	if( isDefined( level.transporter_entries ) && isDefined( level.transporters_targets ) && level.transporters_targets.size )
	{
		for( i = 0 ; i < level.transporter_entries.size ; i++ )
		{
			if( isDefined( level.transporter_entries[i] ) )
				level.transporter_entries[i] thread TransporterThink();
		}
	}
	else
	{
		iPrintLn( "No entries or targets found!" );
	}

}


TransporterThink()
{
	while( isdefined( self ) )
	{
		self waittill( "trigger" , player );

		target = level.transporters_targets[randomInt( level.transporters_targets.size )];

		player setOrigin( target.origin );
		player setPlayerAngles( target.angles );
		player iPrintLnBold( "WHOOOOOOOSHH" );
	}
}

teleports you to different deathmatch-spawns:
Code:
main()
{

	transporters = getEntArray( "enter" , "targetname" );

	if( isDefined( transporters ) )
	{
		for( i = 0 ; i < transporters.size ; i++ )
		{
			if( isDefined( transporters[i] ) )
				transporters[i] thread TransporterThink();
		}
	}

}


TransporterThink()
{
	while( isdefined( self ) )
	{
		self waittill( "trigger" , player );

		targets = getEntArray( "mp_dm_spawn" , "classname" );

		if( !isDefined( targets ) || !targets.size )
		{
			player iPrintLn( "No random target found!" );
			continue;
		}

		target = targets[randomInt( targets.size )];

		player setOrigin( target.origin );
		player setPlayerAngles( target.angles );
		player iPrintLnBold( "WHOOOOOOOSHH" );
	}
}
Share |
BA_GomerPyle
General Member
Since: Jul 26, 2012
Posts: 44
Last: May 18, 2019
[view latest posts]
Level 2
Category: CoDUO Mapping
Posted: Tuesday, Oct. 16, 2012 06:32 am
Well Thank You serthy, it seems to work like a charm.[rocking]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty : CoDUO Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»