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

Very usefull tutorial for beginners.Keep going PjFord!
Reply
#3

Good Job
btw use pawn tags instead of code tags
Reply
#4

How do you do the pawn code? i couldn't find it. do i just put pawn around it instead of code?
Reply
#5

Why the f*ck did you copy my tutorial? <.<
https://sampforum.blast.hk/showthread.php?tid=287885
Reply
#6

i didnt copy it. i put your name in the
credits in the above saying that i used your coordinates -_- that's the only thing i copied from you was the coordinates.
Reply
#7

Quote:
Originally Posted by PjFord
View Post
i didnt copy it. i put your name in the
credits in the above saying that i used your coordinates -_- that's the only thing i copied from you was the coordinates.
1- If there are tutorials out there, why did you bother making another one?
2- It's horribly written.
3- You didn't just copy the coords.
4- I dont give a f*ck about credits.
5- Remove it.
Reply
#8

1. Because this one is more properly explained than yours.
2. So is yours.
3. Yes i did, i copied the coords -_-
4. At least i didnt just copy and paste the thing, i typed all this shit out and decided to just use your coords and put your name in the credits. Everything else besides the coords was hand typed BY ME. not copy and pasted from some other shit like yours probably is. just because you're jealous that my tutorial is better explained, more helpful, and more organized than yours doesn't mean you have to rage about it. -_- /cry
5. UMadBro?
Reply
#9

Quote:
Originally Posted by PjFord
View Post
1. Because this one is more properly explained than yours.
2. So is yours.
3. Yes i did, i copied the coords -_-
4. At least i didnt just copy and paste the thing, i typed all this shit out and decided to just use your coords and put your name in the credits. Everything else besides the coords was hand typed BY ME. not copy and pasted from some other shit like yours probably is. just because you're jealous that my tutorial is better explained, more helpful, and more organized than yours doesn't mean you have to rage about it. -_- /cry
5. UMadBro?
Yes im so jealous about a tutotial based on mine thats centered and that hasnt
got any colors. /cry. Go on i like to see you fail./jealous
Reply
#10

Quote:
Originally Posted by PjFord
View Post
How do you do the pawn code? i couldn't find it. do i just put pawn around it instead of code?
You have to type it as it is not in option.Type [pawn][ /pawn]Without space
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)