Перейти к содержимому
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.

How to use BulletTracePassed?

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

   if (Call("bullettracepassed", issuer.Call("geteye"), target.Call("geteye"), true, issuer))
   {
       Utilities.RawSayAll("Success");
   }
   else
       Utilities.RawSayAll("Fail");

This cause server to crash.

What i want to achieve is : test whether a bullet can penetrate through a wall and reach its target successfully or not? I guessed that bullettracepassed does this. Am I right?

Featured Replies

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

Try making those vector3's into Parameters by using "new Parameter(var)" and passing it that way. Also, do you have that code in the OnSay function? Because calling some functions in the onSay frame (without a delay) causes the server to crash.

Basically a larger view of the code would be nice.

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

Yes, the code is in OnSay event, I put in parameters with afterDelay -> doesn't work

case "!bt":
{
	if (split.Length == 2)
	{
		Entity target = findClientExact(split[1]);
		if (target == null)
			target = findBotExact(split[1]);
		else
		{
			Utilities.RawSayTo(issuer, gmc + "Couldn't find player");
			return false;
		}
		AfterDelay(500, () =>
			{
				if (Call("bullettracepassed", 
					new Parameter (issuer.Call("geteye")), 
					new Parameter (target.Call("geteye")),
					new Parameter(true),
					new Parameter(issuer)
					))
				{
					Utilities.RawSayAll("Success");
				}
				else
					Utilities.RawSayAll("Fail");
			});
	}
	return false;
}

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

I don't see what's missing. Could you please explain more? :|

I tried to change third parameter from true to false.. same thing. :/

 

Are you sure Call isn't the mistake? maybe its not a bool but an int (1 or 0)

I am going to try this out real quick...

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

I don't see what's missing. Could you please explain more? :|

I tried to change third parameter from true to false.. same thing. :/

 

Are you sure Call isn't the mistake? maybe its not a bool but an int (1 or 0)

I am going to try this out real quick...

Yeah... sometimes it does that. And I only linked to that page because I don't know what that function does specifically so I pointed you there so you could verify it yourself.

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

Using Call or Call both give me this error: Cannot cast from source type to destination type.

So it returns another type then bool or int. We need to find out which one.

I am going to look into this some more.

Опубликовано:
Using Call or Call both give me this error: Cannot cast from source type to destination type.

So it returns another type then bool or int. We need to find out which one.

I am going to look into this some more.

if (Call("bullettracepassed", 
                 new Parameter (issuer.Call("geteye")), 
                 new Parameter (target.Call("geteye")),
                 new Parameter(true),
                 new Parameter(issuer)
                 ) == 1)

._.

Опубликовано:
Using Call or Call both give me this error: Cannot cast from source type to destination type.

So it returns another type then bool or int. We need to find out which one.

I am going to look into this some more.

if (Call("bullettracepassed", 
                 new Parameter (issuer.Call("geteye")), 
                 new Parameter (target.Call("geteye")),
                 new Parameter(true),
                 new Parameter(issuer)
                 ) == 1)

._.

 

How did you think that is gonna work? You can't compare a bool to an int...

Or is this sarcasm...?

Опубликовано:
I'm sure there's a way to use it correctly otherwise it won't be available in Call function. I never got "there's no such function" error.

 

Yeah exactly, it's very strange. I Can't figure out how to use it either :(

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

So is there anyone who knows how this works?

 

Server crashes with this error:

MT_AllocIndex: failed allocation of -324 bytes for script usage.

 

Code used:

if (Call("bullettracepassed", new Parameter(rocket.Origin), new Parameter(victim.Origin), new Parameter(true), new Parameter(player)))
{
}

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

Why not just use bulletTrace?

and try this:

case "!bt":
  {
     if (split.Length == 2)
     {
        Entity target = findClientExact(split[1]);
        if (target == null)
           target = findBotExact(split[1]);
        else
        {
           Utilities.RawSayTo(issuer, gmc + "Couldn't find player");
           return false;
        }
        AfterDelay(500, () =>
           {
              if (Call("bullettracepassed", 
                 new Parameter (issuer.Call("geteye")), 
                 new Parameter (target.Call("geteye")),
                 new Parameter(true),
                 new Parameter(issuer)
                 ) == 1)
              {
                 Utilities.RawSayAll("Success");
              }
              else
                 Utilities.RawSayAll("Fail");
           });
     }
     return false;
  }

Опубликовано:
Why not just use bulletTrace?

and try this:

case "!bt":
  {
     if (split.Length == 2)
     {
        Entity target = findClientExact(split[1]);
        if (target == null)
           target = findBotExact(split[1]);
        else
        {
           Utilities.RawSayTo(issuer, gmc + "Couldn't find player");
           return false;
        }
        AfterDelay(500, () =>
           {
              if (Call("bullettracepassed", 
                 new Parameter (issuer.Call("geteye")), 
                 new Parameter (target.Call("geteye")),
                 new Parameter(true),
                 new Parameter(issuer)
                 ) == 1)
              {
                 Utilities.RawSayAll("Success");
              }
              else
                 Utilities.RawSayAll("Fail");
           });
     }
     return false;
  }

 

I already tried that but I will try it again, also, bullettrace doesnt work for me either

Опубликовано:
Why not just use bulletTrace?

and try this:

case "!bt":
  {
     if (split.Length == 2)
     {
        Entity target = findClientExact(split[1]);
        if (target == null)
           target = findBotExact(split[1]);
        else
        {
           Utilities.RawSayTo(issuer, gmc + "Couldn't find player");
           return false;
        }
        AfterDelay(500, () =>
           {
              if (Call("bullettracepassed", 
                 new Parameter (issuer.Call("geteye")), 
                 new Parameter (target.Call("geteye")),
                 new Parameter(true),
                 new Parameter(issuer)
                 ) == 1)
              {
                 Utilities.RawSayAll("Success");
              }
              else
                 Utilities.RawSayAll("Fail");
           });
     }
     return false;
  }

 

I already tried that but I will try it again, also, bullettrace doesnt work for me either

 

Nope: Cannot cast from source type to destination type.

 

Server also crashes with this error: MT_AllocIndex: failed allocation of -324 bytes for script usage.

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

case "!bt":
{
	if (split.Length == 2)
	{
		Entity target = findClientExact(split[1]);
		if (target == null)
			target = findBotExact(split[1]);
		else
		{
			Utilities.RawSayTo(issuer, gmc + "Couldn't find player");
			return false;
		}
		AfterDelay(500, () =>
		{

			Parameter para = Call("bullettracepassed",
			new Parameter(issuer.Call("geteye")),
			new Parameter(target.Call("geteye")),
			new Parameter(true),
			new Parameter(issuer)
			);
			Utilities.RawSayAll(para.Type.ToString());
		});
	}
	return false;
}

I tried to get the type of the parameter after converting it to string.

Using this will crash the server with this error in server console:

[Notifiable] Error during handling timer in script ServerAdmin: System.InvalidCastException: Cannot cast from source type to destination type.

 

I guess this command is just unusable. :|

Опубликовано:
case "!bt":
{
	if (split.Length == 2)
	{
		Entity target = findClientExact(split[1]);
		if (target == null)
			target = findBotExact(split[1]);
		else
		{
			Utilities.RawSayTo(issuer, gmc + "Couldn't find player");
			return false;
		}
		AfterDelay(500, () =>
		{

			Parameter para = Call("bullettracepassed",
			new Parameter(issuer.Call("geteye")),
			new Parameter(target.Call("geteye")),
			new Parameter(true),
			new Parameter(issuer)
			);
			Utilities.RawSayAll(para.Type.ToString());
		});
	}
	return false;
}

I tried to get the type of the parameter after converting it to string.

Using this will crash the server with this error in server console:

[Notifiable] Error during handling timer in script ServerAdmin: System.InvalidCastException: Cannot cast from source type to destination type.

 

I guess this command is just unusable. :|

 

Someone needs to fix that, I am looking at you NTA!

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.