[Tutorial] GangZones

Hello people, someone asked me to make this, so I'm making this for him and for some other people.
I'm not that pro scripter, but I can help (:

In this tutorial, I'll be showing you how to make zones, "Green" or "Purple" or even "Orange". You can make whatever color you want, and whatever place and whatever name.

Now, lets head for scripting, In every single step, I'll explain what I'm doing.
under #include <a_samp> add this
pawn Код:
new GROVE; // We'll use this later
Now we made something "new" But we should define this, I'm right?
Now Lets go under
pawn Код:
public OnGameModeInit()
And type in this
pawn Код:
GROVE = GangZoneCreate(2505.8362, -1649.8331, 2473.1072, -1687.1586);
 //                    minx          miny         maxx       maxy
// Grove
So I'll convert everything into a chart, so it makes you understand better.

http://imgur.com/ySfM5 <--------
incase it didn't work, click the link |

Where I've written '/save' you should save, and if you saved this in the same order I've told you in graph
Then you should have something like this
Goto documents > GTA User files > SAMP > Savedpostions.txt (warning: after u save u do this)
Open it and you should have it like this:

AddPlayerClass(0,2505.0696,-1681.8076,13.5469,348.4980,0,0,0,0,0,0); //
AddPlayerClass(0,2506.3909,-1654.5638,13.5938,168.9796,0,0,0,0,0,0); //
AddPlayerClass(0,2466.7537,-1651.8214,13.4711,183.0798,0,0,0,0,0,0); //
AddPlayerClass(0,2469.1792,-1686.3413,13.5137,0.1148,0,0,0,0,0,0); //
What Are we going to use, im going to mark them
MIN X = 2505.0696
MIN Y = -1654.5638
MAX X = 2466.7537
MAX Y = -1686.3413
This is if you saved them correctly! In the SAME ORDER As the GRAPH!!
Remember this we used at first?
GROVE = GangZoneCreate(2505.0696, -1654.5638, 2466.7537, 1686.3413);
minX minY maxX maxY
Now we are going to replace the codes
I've already replaced them
Finally, we are going to show the player this with some codes
Goto OnPlayerSpawn(playerid)
pawn Код:
public OnPlayerSpawn(playerid) // when the player spawns
    GangZoneShowForPlayer(playerid, GROVE, 0x00FF00AA); // show the zone, now we used the defined thing
//                                   we defined GROVE remember? Now we should use it
//    0x00FF00AA = Means Green colour
    SetPlayerPos(playerid, 2511.5229, -1669.0779, 14); // Type this just to spawn @ grove, to see if ur script
// works, it should work
    return 1;
Congratulations, now you made a zone!
If you want to make Ballas, just go up and type new BALLA;
And get the saved positions, etc etc.
This position i made is a small square(but visible) just to test, you can make bigger, the bigger square, the bigger position. I used Green color for this.
I jsut checked the graph, and the post made it look bad, wait I'll make a screen and i'll edit


Originally Posted by PjFord
Посмотреть сообщение
So what if there's a tutorial on it already? There's plenty of tutorials on same case! Do not post useless offtopic posts.
Nice tutorial, otherwise.

Well, did you even test your example ?

MIN X = 2505.0696 <- WRONG, 2466.7537 is smaller
MIN Y = -1654.5638 <- WRONG, -1686.3413 is smaller
MAX X = 2466.7537 <- WRONG , 2505.0696 is bigger
MAX Y = -1686.3413 <- WRONG, -1654.5638 is bigger
This also applies to this:
pawn Код:
GROVE = GangZoneCreate(2505.8362, -1649.8331, 2473.1072, -1687.1586);
 //                    minx          miny         maxx       maxy
// Grove
Actually you don't need to save your position at 4 spots to create a rectancle / sqaure.
2 SAVE + 4 SAVE or 1 SAVE + 3 SAVE.

Uhh well, My script works really well.
And thanks.
GoldKiller, maybe im not trying to make this script 'epic' but im letting people to understand how to create one without just copying my text, that's my whole point
So what? You also did that tutorail and there was someone who did that before you, "firecat" So stop being like you never copy, mister.

Lol at least mine works

Hehe, nice job anyway!

lol'd you should use 'You don't say'
pjford, and mine works too (:

Forum Jump:

Users browsing this thread: 1 Guest(s)