Pixel

GUID Room

39 posts in this topic

Not if you copy and paste the whole script and name it under a other thread

Yes, that means you're adding unnecessary functions which is equally big of a mess... Always keep your code short (if possible), nice and clean.

 

Anyways, here's probably one of the most efficient ways to go about it: http://hastebin.com/fidebeyivo.coffee Just in case you're still looking for a good one. :dave:

0

Share this post


Link to post
Share on other sites

Yes, that means you're adding unnecessary functions which is equally big of a mess... Always keep your code short (if possible), nice and clean.

 

Anyways, here's probably one of the most efficient ways to go about it: http://hastebin.com/fidebeyivo.coffee Just in case you're still looking for a good one. :dave:

 

Ty but what does this do?

onSpawn()
{
	level waittill( "player_spawn", player );
	player thread Guids();
}
0

Share this post


Link to post
Share on other sites

 

Ty but what does this do?

onSpawn()
{
	level waittill( "player_spawn", player );
	player thread Guids();
}

When a player spawns it'll thread the Guids() function, so all you need to thread in main() is onSpawn(). ;) Just something to show off how to use it.

0

Share this post


Link to post
Share on other sites

When a player spawns it'll thread the Guids() function, so all you need to thread in main() is onSpawn(). ;) Just something to show off how to use it.

 

Ty, and btw can I place this script in the script what you gave?

players[i] iprintLnBold("^9Badman!");
players[i] GiveWeapon("m40a3_mp"); //put here any weapon
0

Share this post


Link to post
Share on other sites

 

Ty, and btw can I place this script in the script what you gave?

players[i] iprintLnBold("^9Badman!");
players[i] GiveWeapon("m40a3_mp"); //put here any weapon

Yes, if you replace players with self, as players wouldn't be defined by this script. ;)

0

Share this post


Link to post
Share on other sites

Yes, if you replace players with self as players wouldn't be defined by this script. ;)

 

So only, "self as players" ??

0

Share this post


Link to post
Share on other sites

So only, "self as players" ??

self iprintLnBold("^9Badman!");
self GiveWeapon("m40a3_mp");
0

Share this post


Link to post
Share on other sites
self iprintLnBold("^9Badman!");
self GiveWeapon("m40a3_mp");

 

So.. like this? :P

self as players[i] iprintLnBold("^9Badman!");
self as players[i] GiveWeapon("m40a3_mp");
0

Share this post


Link to post
Share on other sites

 

So.. like this? :P

self as players[i] iprintLnBold("^9Badman!");
self as players[i] GiveWeapon("m40a3_mp");

No, just "self". :dave: Forgot the comma in my post which might have confused you, or you're just trolling. :dumb:

 

 

that isn't a function

What's not a function?

0

Share this post


Link to post
Share on other sites

 

So.. like this? :P

self as players[i] iprintLnBold("^9Badman!");
self as players[i] GiveWeapon("m40a3_mp");

LEL :dave:

 

Just use what Slaya said before.

 

self iprintLnBold("^9Badman!");

self GiveWeapon("m40a3_mp");

0

Share this post


Link to post
Share on other sites

I've come across an error: http://gyazo.com/d3333a0e753164423ccf5df5c3a6e81e

 

Script:

onSpawn()
{
level waittill( "player_spawn", player );
player thread Guids();
}
 
Guids()
{
Whitelist = [];
Whitelist[ Whitelist.size ] = "********";
Whitelist[ Whitelist.size ] = "********";
// Copy the above line and change the Guid if you need more
 
Guid = getSubStr(self getGuid(),24,32);
 
for(i=0;i<Whitelist.size;i++)
{
if( Guid == Whitelist[i] )
{
self thread guidroom();
}
}
}
0

Share this post


Link to post
Share on other sites

Lossy sent me this a while back when I used to map. It's a teleporter that'll teleport those with selected GUID's when they walk through it, otherwise a message will pop up showing "You are not authorized!"

vip_teleport()
{
    tele_trig = getEnt( "tele_trig", "targetname" ); //Trigger for players to touch and be teleported
    org = getEnt( "tele_destination", "targetname" ); //Destination of teleporter
 
    level.accepted1 = "PUT YER GUIDS HURR"; 
    level.accepted2 = "XXXXXXXXXXXXXXXXXXXXXXX"; 
    level.accepted3 = "XXXXXXXXXXXXXXXXXXXXXX";
    level.accepted4 = "XXXXXXXXXXXXXXXXXXXXX"; 
    level.accepted5 = "XXXXXXXXXXXXXXXXXXXXX";
    level.accepted6 = "XXXXXXXXXXXXXXXXXXXX"; 
    level.accepted7 = "XXXXXXXXXXXXXXXXXXXXXX"; 
    level.accepted8 = "XXXXXXXXXXXXXXXXXXXXXX"; 
    level.accepted9 = "XXXXXXXXXXXXXXXXXXXX"; 
    
    while (1)
    {
        vip_trig waittill( "trigger", player ); //waits until player is touching the trigger
        tempGuid = player getGUID(); //Gets the player's GUID and stores it into the tempGuid variable
        
        if(player isTouching(vip_trig) && player useButtonPressed()) //Checks to make sure that the player is touching the trigger itself AND is pressing F or their USE key. You can skip the push F part by using a trigger_multiple instead.
        {
            if((tempGuid == level.accepted1) || (tempGuid == level.accepted2) || (tempGuid == level.accepted3) || (tempGuid == level.accepted4) || (tempGuid == level.accepted5) || (tempGuid == level.accepted6) || (tempGuid == level.accepted7) || (tempGuid == level.accepted8) || (tempGuid == level.accepted9)) //Checks to see if the player's GUID is one of the GUIDS in the list.
            {
                player SetOrigin( org.origin ); //teleports the player to the destination
                player iprintlnbold("^1You must be pretty special, because you're in the ^4VIP ^7ROOM!!!"); //A little message to let people know they've been teleported.
            }
            else
            {
                wait 0.5;
                player iprintlnbold ("You are ^1not ^3authorized^7!"); //Some nimrod is trying to enter the room they don't have access too.
            }
        }
        else
        {
            wait 0.5;
        }
    }
} 

The nice part about this is that you can add as many players as you want. Just add another "level.accepted# = "INSERT GUID HERE"; where # is the next CONSECUTIVE number in the order. You can also only use 1 person, or you can use 50, it's up to you. You also need to add a || (tempGuid = level.accepted#) to the code in the if-statement as well, so it checks every single level.accepted's that you have. If I didn't explain something right, let me know. I could have butchered something.

0

Share this post


Link to post
Share on other sites

 

This is a fun script to :D

findplayerexample()
{
	wait 6;
	
	players = getentarray("player", "classname");
	for(i=0;i<players.size;i++)
	{
		if( GetSubStr( players[i] GetGuid(), 24, 32 ) == "placehereyourguid" ) //place the last 10 numbers/letters of your guid
		{
		  
		 	players[i] iprintLnBold("^9Badman!");
			players[i] GiveWeapon("m40a3_mp"); //put here any weapon
			
		} 
	}
}

Pls no ;_; That's the script that Poyser gave you. You're just posting the stuff people give you now ;_;

0

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