[Tutorial] How to create GangZones[0.3c]
#1

Introduction
Hello, today im going to show you how to create some simple gangzones for GTA SAMP.
First, you're going to want to open up your pawno. (duh)
Creating The Variables
Let's say you want to make a gangzone for Grove street. First, you're going to go to your Variable list (if you dont have a variable list on your script, just choose somewhere up at the top but underneath the includes and defines).
So it would look something like this:
pawn Code:
new gangzone1;
Note: you dont have to put "gangzone1". put something that you will remember easily. for example, for grove street you could put:
pawn Code:
new gsfzone;
it's that simple! all this is doing is creating a variable for your zone. i'll get more into that later.
Getting The Coordinates
Now you're going to go into a SAMP server or just into SAMP Debug. All you need to do is imagine the gangzone on the map. you're going to need to go to the North Side, East Side, South Side, and West Side of the zone you want. so use /save max_y /save min_y /save max_x and /save min_x. it's that simple! Now you will end up with something like this:
pawn Code:
AddPlayerClass(120,2220.3711,1372.5238,7.1953,1.95 97,0,0,0,0,0,0); // min_x
AddPlayerClass(120,-2620.6538,-1937.0173,7.1875,97.2865,0,0,0,0,0,0); // min_y
AddPlayerClass(120,2737.8306,1300.1874,12.6532,186 .6597,0,0,0,0,0,0); // max_x
AddPlayerClass(120,-2577.2681,-1372.4310,7.1875,352.5596,0,0,0,0,0,0); // max_y
Note: They're not going to be the exact same, more than likely you're not going to /save in the exact same spot as i did.
So once you have those, you're only going to need 1 set of numbers from each line. This is what you'll need: (the darker boldish numbers)
pawn Code:
AddPlayerClass(120,[B]2220.3711[/B],1372.5238,7.1953,1.9597,0,0,0,0,0,0); // min_x
AddPlayerClass(120,-2620.6538[B],-1937.0173[/B],7.1875,97.2865,0,0,0,0,0,0); // min_y
AddPlayerClass(120,[B]2737.8306[/B],1300.1874,12.6532,186.6597,0,0,0,0,0,0); // max_x
AddPlayerClass(120,-2577.2681[B],-1372.4310[/B],7.1875,352.5596,0,0,0,0,0,0); // max_y
Defining the Variables
So under OnGameModeInit or if your creating a filterscript OnFilterscriptInit
Add this:
pawn Code:
gsfzone = [B]GangZoneCreate(2220.3711,-1937.0173,2737.8306,-1372.4310[/B]);
Now if you remember, we made the variable "gsfzone". This is simply telling the server what that variable represents. in this case it represents The above that is in Bold.
Now that you have created a variable and told the server what that variable stands for, we have to allow other players to see the gangzone on the map.
Setting it up
So, you're going to go to OnPlayerConnect and type in this:
pawn Code:
public OnPlayerConnect
{
        GangZoneShowForPlayer(playerid,gsfzone,0x00C714AA);
        return 1;
}
Now, what this means is very simple. the fuction "GangZoneShowForPlayer" is simply telling the server to show the gangzone to everyone else. playerid is doing what i just said. gsfzone is the variable which is representing the coordinates for the gangzone, and the the 0x00C714AA is the hex code for the color. Now, you see the AA at the ending, that is special. AA is telling it to do little or no transparency, while if you put something like 0x00C71488, see the "88" is in place of the "AA" it will be more transparent. So now you should have something that looks like this:
Examples
For a Filterscript:
pawn Code:
new gsfzone;

public OnFilterScriptInit()
{
        gsfzone = GangZoneCreate(2220.3711,-1937.0173,2737.8306,-1372.4310);
        return 1;
}


public OnPlayerConnect(playerid)
{
        GangZoneShowForPlayer(playerid,gsfzone,0x00C714AA);
        return 1;
}
For a Gamemode just add this into your gamemode:
pawn Code:
new gsfzone;

public OnGameModeInit()
{
        gsfzone = GangZoneCreate(2220.3711,-1937.0173,2737.8306,-1372.4310);
        return 1;
}


public OnPlayerConnect(playerid)
{
        GangZoneShowForPlayer(playerid,gsfzone,0x00C714AA);
        return 1;
}
Now compile it and if you have any errors feel free to comment and i will try my best to help you. Hope this helped someone.

Credits:
Firecat. i used his coordinates and even though he's a total nub im going to put him in these credits anyway.
Screenshots
Screenshot of what it should look like afterwards:
Reply


Messages In This Thread
How to create GangZones[0.3d][OutDated] - by PjFord - 14.12.2011, 03:34
Re: How to create GangZones[0.3c] - by Ironboy - 14.12.2011, 05:26
Re: How to create GangZones[0.3c] - by §с†¶e®РµРe - 14.12.2011, 13:01
Re: How to create GangZones[0.3c] - by PjFord - 14.12.2011, 20:47
Re: How to create GangZones[0.3c] - by FireCat - 14.12.2011, 21:28
Re: How to create GangZones[0.3c] - by PjFord - 14.12.2011, 21:46
Re: How to create GangZones[0.3c] - by FireCat - 14.12.2011, 21:49
Re: How to create GangZones[0.3c] - by PjFord - 14.12.2011, 22:03
Re: How to create GangZones[0.3c] - by FireCat - 15.12.2011, 06:26
Re: How to create GangZones[0.3c] - by §с†¶e®РµРe - 17.12.2011, 03:02

Forum Jump:


Users browsing this thread: 1 Guest(s)