SA-MP Forums Archive
Come help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Come help (/showthread.php?tid=594725)



Come help - oppo1234 - 22.11.2015


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


Re: Come help - oppo1234 - 22.11.2015

how to write WORLD BOUNDRIES


Re: Come help - Yashas - 22.11.2015

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.


Re: Come help - lucamsx - 22.11.2015

https://sampwiki.blast.hk/wiki/GameTextForPlayer


Re: Come help - oppo1234 - 22.11.2015

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


Re: Come help - oppo1234 - 22.11.2015

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


Re: Come help - oppo1234 - 22.11.2015

Players range of activities


Re: Come help - Yashas - 22.11.2015

Код:
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.


Re: Come help - AbyssMorgan - 22.11.2015

https://sampwiki.blast.hk/wiki/SetPlayerWorldBounds


Re: Come help - oppo1234 - 22.11.2015

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?