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

[Help]Can I set player's direction?

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

Hi. Thanks for your help.

 

Is there a way to set player's direction?

 

I know how to set player's origin, but i don't know to set player's direction.

 

To South, North, East, or West. or to lookup/lookdown.

 

if i can control player's direction, it's possible to make bots shot to specific direction.

Thank you.

Featured Replies

Опубликовано:
Player entities have a field called: angles, it returns a vector3.

You can set the "direction" of the player by changing that.

 

Thanks. however, i don't know how to apply it.

 

I usually look through Infinity Script before asking something.

I also know there is "angles"..

 

Could you show me some example?

Опубликовано:
Player entities have a field called: angles, it returns a vector3.

You can set the "direction" of the player by changing that.

All entites have the field angles. And for players you use its specific function called SetPlayerAngles.

Опубликовано:
Player entities have a field called: angles, it returns a vector3.

You can set the "direction" of the player by changing that.

All entites have the field angles. And for players you use its specific function called SetPlayerAngles.

 

Thanks for tips.

PlayerConnected += new Action(player =>
           {
               Vector3 A = new Vector3(player.Origin.X, player.Origin.Y, player.Origin.Z);
               Vector3 B = new Vector3(player.Origin.X - 90, player.Origin.Y, player.Origin.Z);
               Vector3 temp = Call("vectortoangles", new Parameter(A - );
               Vector3 angles = new Vector3(temp.Z - 45, temp.Y, temp.X);//90
               player.SetField("SetPlayerAngles", angles);
               player.SetField("SetPlayerAngles", "0 50 0");
               player.SetField("angles", "0 50 0");
               player.SetClientDvar("SetPlayerAngles", "0 50 0");
           });

 

however, these don't work..

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

As I said SetPlayerAngles is a function so in your case you would use

player.Call("SetPlayerAngles", ....),

The parameter is a vector3. Supplying a string ("0 50 0") will make the function fail or even crash the game.

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

Thank you all, for help.

 

player.Call("SetPlayerAngles", new Parameter(new Vector3(-2151.714f, 120.9076f, 143.1634f)));

 

it works.!!!

Thanks to zxz0O0 and Aalalex for help.

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.