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

Members Online

»
1 Active | 48 Guests
Online:

LATEST FORUM THREADS

»
Call of DutyŽ: WWII
CoD WW2 General
SOF2 Prefabs map
SoFII 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: World at War
Category: CoDWW MP Mapping
CoD: World at War Multiplayer mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Next Page
subscribe
Author Topic: Admin room
joshpk
General Member
Since: Apr 20, 2010
Posts: 11
Last: May 25, 2011
[view latest posts]
Level 1
Category: CoDWW MP Mapping
Posted: Tuesday, Apr. 27, 2010 10:52 pm
I was wondering how you would make it so that only selected players can use a trigger or just admins able to use a teleport using either names or guids or even something that can tell that someone is an admin, something like that.
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoDWW MP Mapping
Posted: Wednesday, Apr. 28, 2010 08:27 am
You must either grab the player as an entity and get their GUID or Name and check it against a list, or assign each player a variable on connect/spawn and once checked against a list, make it true or false.

Example:

Code:

AdminTrigger()
{
	trigger = GetEnt( "admin_thing", "targetname" );
	name = "nameIwant";
	
	while(1)
	{
		trigger waittill( "trigger", player );
		
		if( player.name == name )	// This will check if the player name matches the name variable
		{
			player thread DoStuff();	// And if so will then thread the function on the player
		}
		// All other players who don't match will cause nothing to happen
	}
}
Share |
DeekCiti
General Member
Since: Mar 12, 2008
Posts: 1293
Last: Jul 8, 2016
[view latest posts]
Level 8
Category: CoDWW MP Mapping
Posted: Wednesday, Apr. 28, 2010 09:14 am
Getting the players name is a good idea, but I have found that keeping the names that are in code secret is harder than thought.

You will find that the players told what name is valid will only last so long before people are cheating and "renaming" themselves just to get in the teleport or door that is supposed to be secret or for admins.

I think assigning a variable to each player when entering or checking the GUID is a better work around for this sort of thing.
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoDWW MP Mapping
Posted: Wednesday, Apr. 28, 2010 11:31 am
Well the most secure way is to use a dvar and split it into into sub-strings to filter through, and do this with GUIDs. But that is a bit complex for somebody new to scripting.
Share |
BraX
General Member
Since: Apr 29, 2008
Posts: 413
Last: May 26, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoDWW MP Mapping
Posted: Wednesday, Apr. 28, 2010 12:00 pm
Edited code from Xyolzi, this one will check guid.
Code:

AdminTrigger()
{
	trigger = GetEnt( "admin_thing", "targetname" );
	guid = "1234567"; // Replace with your's own guid.
	
	while(1)
	{
		trigger waittill( "trigger", player );
		
		if( player getGuid() == guid ) 
		{
			player thread DoStuff();
		}
	}
}
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoDWW MP Mapping
Posted: Wednesday, Apr. 28, 2010 01:51 pm
If you want to use a dvar to add unlimited admins, then this script will check each GUID in the dvar, with each entry seperated by a space.

Code:

SetupAdminTrigger()
{
	SetDvar( "scr_admins_guids" );

	trigger = GetEntArray( "admin_trigger", "classname" ); // If you want more than one
	for( i = 0; i < trigger.size; i++ )
	{
		trigger[i] thread MonitorTrigger();
	}
}

MonitorTrigger()
{
	while(1)
	{
		self waittill( "trigger", player );
		
		player.admin = player thread CheckGUID();
		
		if( player.admin )
			thread DoStuff();
	}
}

CheckGUID()
{
	admin = false;
	pGuid = self GetGUID();
	
	guids = StrTok( GetDvar( "scr_admins_guids" ), " " ); // Each guid has to be seperated with a space
	
	for( i = 0; i < guids.size; i++ ) // Cycle through each GUID
	{
		guid = guids[i];
	
		if( ToLower( pGuid ) == ToLower( guid ) )
			admin = true;
		else
			admin = false;
	}
	
	return admin;
}
Share |
joshpk
General Member
Since: Apr 20, 2010
Posts: 11
Last: May 25, 2011
[view latest posts]
Level 1
Category: CoDWW MP Mapping
Posted: Wednesday, Apr. 28, 2010 07:25 pm
alright i added that and made it so that it teleports you, now how would i make it print text in the middle of the screen saying "You are not an admin!"

Thank you for the help so far i appreciate it.

I just noticed that it teleports because of a different line, it teleports no matter what guid.

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

transporter()
{
  while(1)
  {
   self waittill("trigger",other);
   entTarget = getent(self.target, "targetname");
   wait(0.50);
   other setorigin(entTarget.origin);
   other setplayerangles(entTarget.angles);
   wait(0.50);
  }
}

AdminTrigger()
{
	trigger = GetEnt( "admin_thing", "targetname" );
	guid = "1111111111"; // Replace with your's own guid.
{
	while(true)
	{
		trigger waittill( "trigger", player );
		
		if( player getGuid() == guid ) 
		{
			player thread transporter();
		
		}
	else
		iprintLn("^2YOUR NOT AN ADMIN!");
			}
		}
}


i know thats not my guid

edited on Apr. 28, 2010 10:25 pm by joshpk
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoDWW MP Mapping
Posted: Wednesday, Apr. 28, 2010 11:22 pm
Code:

main()
{
	thread AdminTrigger();
}

AdminTrigger()
{
	trigger = GetEnt( "admin_thing", "targetname" );
	guid = "1111111111"; // Replace with your's own guid.

	while(true)
	{
		trigger waittill( "trigger", player );
		
		if( player getGuid() == guid ) 
			trigger thread Teleport( player );
		else
			iprintLn("^2YOUR NOT AN ADMIN!");
	}
}

Teleport( player )
{
   entTarget = getent( self.target, "targetname");
   wait(0.50);
   other setOrigin( entTarget.origin );
   other setPlayerAngles( entTarget.angles );
   wait(0.50);
}
Share |
joshpk
General Member
Since: Apr 20, 2010
Posts: 11
Last: May 25, 2011
[view latest posts]
Level 1
Category: CoDWW MP Mapping
Posted: Thursday, Apr. 29, 2010 06:09 pm
I tried it, i got an error

Error:
******* Server script compile error *******
Error: uninitialised variable 'other': (file 'maps/mp/_teleportadmin.gsc', line 26)
other setOrigin( entTarget.origin );
*
************************************
Share |
Xylozi
General Member
Since: Jul 12, 2008
Posts: 218
Last: Mar 1, 2012
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoDWW MP Mapping
Posted: Thursday, Apr. 29, 2010 11:24 pm
Change other to player.
Share |
Restricted Access Topic is Locked
Page
Next Page
subscribe
MODSonline.com Forums : Call of Duty: World at War : CoDWW MP 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

»