Come help
#1


Like the picture the same, how should I write such a script?
Reply
#2

how to write WORLD BOUNDRIES
Reply
#3

You need to use GetPlayerPos to obtain the coordinates of the player. Then compare it with your boundary coordinates to check if the player is within the range.

If you need a spherical range then you have to:
Код:
if(radius > VectorSize(SphereCenterX-playerX, SphereCenterY-playerY, SphereCenterZ-playerZ))
{
     GameTextForPlayer(playerid, "Stay within~r~ world boundries", 1000, 5);
}
You have to do the above check periodically. You are either use OnPlayerUpdate (not recommended) or do the checks in a timer.

If you wanted to know how to send such text messages, you need to use GameTextForPlayer. The GameText Style/Type used in the picture is type 5.
Reply
#4

https://sampwiki.blast.hk/wiki/GameTextForPlayer
Reply
#5

Quote:
Originally Posted by Yashas
Посмотреть сообщение
You need to use GetPlayerPos to obtain the coordinates of the player. Then compare it with your boundary coordinates to check if the player is within the range.

If you need a spherical range then you have to:
Код:
if(radius > VectorSize(SphereCenterX-playerX, SphereCenterY-playerY, SphereCenterZ-playerZ))
{
     GameTextForPlayer(playerid, "Stay within~r~ world boundries", 1000, 5);
}
You have to do the above check periodically. You are either use OnPlayerUpdate (not recommended) or do the checks in a timer.

If you wanted to know how to send such text messages, you need to use GameTextForPlayer. The GameText Style/Type used in the picture is type 5.
Can you help me write a do,To forum
Reply
#6

Quote:
Originally Posted by lucamsx
Посмотреть сообщение
No, I want to write a zone boundary
Reply
#7

Players range of activities
Reply
#8

Код:
for(new i = GetPlayerPoolSize(); i >= 0; i--)
{
      new Float:x, Float:y, Float:z;
      GetPlayerPos(playerid, x, y, z);

      if(100 > VectorSize(SphereCenterX - x, SphereCenterY - y, SphereCenterZ - Z))
      {
           //Player is outside the boundary
      }
}
Add that code in some timer.

Or another solution is to use streamer. It has a feature called dynamic areas.

Its faster and easier but you'll have to learn about it.
Reply
#9

https://sampwiki.blast.hk/wiki/SetPlayerWorldBounds
Reply
#10

Quote:
Originally Posted by Yashas
Посмотреть сообщение
You need to use GetPlayerPos to obtain the coordinates of the player. Then compare it with your boundary coordinates to check if the player is within the range.

If you need a spherical range then you have to:
Код:
if(radius > VectorSize(SphereCenterX-playerX, SphereCenterY-playerY, SphereCenterZ-playerZ))
{
     GameTextForPlayer(playerid, "Stay within~r~ world boundries", 1000, 5);
}
You have to do the above check periodically. You are either use OnPlayerUpdate (not recommended) or do the checks in a timer.

If you wanted to know how to send such text messages, you need to use GameTextForPlayer. The GameText Style/Type used in the picture is type 5.
Quote:
Originally Posted by Yashas
Посмотреть сообщение
Код:
for(new i = GetPlayerPoolSize(); i >= 0; i--)
{
      new Float:x, Float:y, Float:z;
      GetPlayerPos(playerid, x, y, z);

      if(100 > VectorSize(SphereCenterX - x, SphereCenterY - y, SphereCenterZ - Z))
      {
           //Player is outside the boundary
      }
}
Add that code in some timer.

Or another solution is to use streamer. It has a feature called dynamic areas.

Its faster and easier but you'll have to learn about it.
Can specific point?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)