[Tutorial] How to create areas not dm / Pacific
#1

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
Reply
#2

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.
Reply
#3

sorry, already under
Reply
#4

nice tutorial
Reply
#5

Good tutorial
Reply
#6

nice one
Reply
#7

Nice tut
Reply
#8

Nice one.
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)