Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Release] Specific Anti Camp Spots

Опубликовано:

So here's something I did a while back that I'd thought I'd release. It's basically a script to warn and prevent people from camping in specific spots. I have 3 examples on there. The first way is instant prevent. There's also a timed anti-camp ( If the person stays in the spot for x amount of seconds.)

 

CampSpots()
{	
   CampPositions         = [];   
   CampPositions[0]      = (-360, 506, -225);        // Truck @ rust
   CampPositions[1]      = (-598.9, -2158, 120.1);   // Stairs @ nightshift
   CampPositions[2]      = (612.9, 4206.7, 242.6);   // Cockpit @ terminal

   self thread MapSpots( CampPositions ); 
}

MapSpots( CampPositions )
{
if( getDvar( "mapname" ) == "mp_rust" )
{
	spot = CampPositions[0];
	trigger = spawn("trigger_radius", spot, 0, 200, 200);
	trigger thread earthquaketrigger( spot, 200, "none" );
}

if( getDvar( "mapname" ) == "mp_nightshift" )
{
	spot = CampPositions[1];
	trigger = spawn("trigger_radius", spot, 0, 200, 200);
	trigger thread earthquaketrigger( spot, 200, "trigger_timed" );
}

if( getDvar( "mapname" ) == "mp_terminal" )
{
	spot = CampPositions[2];
	trigger = spawn("trigger_radius", spot, 0, 200, 200);
	trigger thread earthquaketrigger( spot, 100, "none" );
}

else
{
	spot = undefined;
}
}

earthquaketrigger(spot, size, flag)
{ 
     for(;
     {
           self waittill("trigger", player);

			if( flag == "trigger_timed" )
			{
				self thread earthquaketrigger_timed( spot, size, player );	
			}

			else
			{
				player iPrintLnBold("You can't camp here!");
				earthquake ( 0.8, 5, spot, size );
				self pingPlayer();
				wait( 3 );
			}
     }
}

earthquaketrigger_timed( spot, size, player )
{	
wait( 4 );

	if ( distance( spot, self.origin ) <= 10 )
	{
		player iPrintLnBold("You can't camp here!");
		earthquake (0.8, 5, spot, size);
		self pingPlayer();
	}

	else
	{
		return;
	}
}

Featured Replies

Опубликовано:
Pretty cool! You could possibly let people add locations through a dvar or so.

hmmm... Its not THAT easy...

 

Something like this might work, not sure. Haven't tested it.

 

LoadCampSpots()
{
CampPositions = [];
level.campspots = getDvar("campspots");
level.campArray = StrTok( level.camspots, "_" );

for (i = 0; level.campArray[i] != "_"; i++) {
	CampPositions[i] = level.CampArray[i];
	wait 2;
}

}

Опубликовано:
  • Автор

Yeah, it's very possible, but it's just easier for me to have a static set of positions, as they don't change. You might even be able do something as simple as:

 

setDvarifUninitialized("spot1", "0, 0, 0")
and spot = getDvar("spot1");

Опубликовано:

What do you thing about this?

 


init()
{
level thread onPlayerConnect();
}

onPlayerConnect()
{
for(;
{
	level waittill( "connected", player);
	player thread onPlayerSpawned();
}
}

onPlayerSpawned()
{
self endon("disconnect");

self thread getCampPositions();

for(;
{
	self waittill("spawned_player");
}
}

getCampPositions()
{
// 	self thread CampPositions(mapname, x, y, z, type );

	self thread CampPositions("mp_rust", -360, 506, -225 ,"trigger_timed");	// Car @ rust
	self thread CampPositions("mp_rust", -260, 0, -201 ,"none");		// Truck @ rust
}

CampPositions(mapname, x, y, z, trigger)
{
if( getDvar( "mapname" ) == mapname )
{
	spot = (x, y, z);
	trigger = spawn("trigger_radius", spot, 0, 200, 200);
	trigger thread earthquaketrigger( spot, 200, trigger );
}
}

earthquaketrigger(spot, size, flag)
{
     for(;
     {
           self waittill("trigger", player);

           if( flag == "trigger_timed" )
           {
              self thread earthquaketrigger_timed( spot, size, player );   
           }

           else
           {
              player iPrintLnBold("You can't camp here!");
              earthquake ( 0.8, 5, spot, size );
              self pingPlayer();
              wait( 3 );
           }
     }
}

earthquaketrigger_timed( spot, size, player )
{   
  wait( 4 );

     if ( distance( spot, self.origin ) <= 10 )
     {
        player iPrintLnBold("You can't camp here!");
        earthquake (0.8, 5, spot, size);
        self pingPlayer();
     }
     else
     {
        return;
     }
}

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.