SA-MP Forums Archive
[Tutorial] How to create areas not dm / Pacific - 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)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to create areas not dm / Pacific (/showthread.php?tid=235122)



How to create areas not dm / Pacific - Lunnatiicz - 05.03.2011

Before you begin to appreciate, thanks to [L3th4l] for having guided how to create these zones and the server by the idea Camiloasc1

Before starting I recommend you download This program to be able to get the coordinates of your area.

Good start.




The parameters and functions that will use are part of "Streamer" and are as follows

pawn Код:
forward OnPlayerEnterDynamicArea(playerid, areaid);
forward OnPlayerLeaveDynamicArea(playerid, areaid);
native CreateDynamicRectangle(Float:minx, Float:miny, Float:maxx, Float:maxy, worldid = -1, interiorid = -1, playerid = -1);
Note :can be in any wayPost Original By Incognito for see her Functions/params

We are start with the next Callback

pawn Код:
new YourZone;

public OnGameModeInit()
{
        YourZone = CreateDynamicRectangle(minx, miny, maxx, maxy, -1, -1, -1);
        return 1;
}
In this we create a Rectangle, how see in the code

Note: Change the params for yours coordinates


Now to do that when a player between to this area do Remover action against such weapons, giving, etc.


pawn Код:
public OnPlayerEnterDynamicArea(playerid, areaid)
{
if(areaid == YourZone)
    {
      GameTextForPlayer(playerid, "You are in the area, yours arms was removed!", 4000, 3);//text in the screen of the player D:
      ResetPlayerWeapons(playerid);//this remove arms
      }
      return 1;
}
Now for when the player out of this area

pawn Код:
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
     if(areaid == YourZone)
    {
        GameTextForPlayer(playerid, "You're exit of the area, permitted weapons!", 4000, 3);//Text in the Screen
        //You can add more funcions how GivePlayerWeapon..
        }
    return 1;
}
This is everything xD!

Note: I don't speak very well english S: Tell me any error



Respuesta: How to create areas not dm / Pacific - leaNN! - 05.03.2011

Like i said in Spanish section...
pawn Код:
public OnPlayerLeaveDynamicArea(playerid, areaid)
{
     if(areaid == YourZone)
    {
        GameTextForPlayer(playerid, "You're exit of the area, permitted weapons!", 4000, 3);//Text in the Screen
//You can add more funcions how GivePlayerWeapon..
    }
    return 1;
}
Now it will work.


Respuesta: How to create areas not dm / Pacific - Lunnatiicz - 05.03.2011

sorry, already under


Re: How to create areas not dm / Pacific - CBCandyBoy - 05.01.2013

nice tutorial


Re: How to create areas not dm / Pacific - RedCrossER - 05.01.2013

Good tutorial


Re: How to create areas not dm / Pacific - dEcooR - 23.07.2013

nice one


Re: How to create areas not dm / Pacific - ScRipTeRi - 24.07.2013

Nice tut


Re: How to create areas not dm / Pacific - Vin Diesel - 08.04.2017

Nice one.


Re: How to create areas not dm / Pacific - coool - 08.04.2017

Good Explanations. But: Players will enter in area, their weapons lost, out of area no weapons givin and then he is sad! Their weapons should be given when out of area


Re: How to create areas not dm / Pacific - Astralis - 17.04.2017

Quote:
Originally Posted by coool
Посмотреть сообщение
Good Explanations. But: Players will enter in area, their weapons lost, out of area no weapons givin and then he is sad! Their weapons should be given when out of area
I would just make a mapped place and put player in another world when he enters /dm.