08.04.2012, 10:25
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 (:
( STRCMP )
Introduction
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.
Scripting
Now, lets head for scripting, In every single step, I'll explain what I'm doing.
under #include <a_samp> add this
Now we made something "new" But we should define this, I'm right?
Now Lets go under
And type in this
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!!
EDITED
HOPE U UNDERSTAND
!!
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)
-
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.
Conclusion
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
WARNING LOOK UP ^ I'LL FIX IT
I'm not that pro scripter, but I can help (:
( STRCMP )
Introduction
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.
Scripting
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 Lets go under
pawn Код:
public OnGameModeInit()
pawn Код:
GROVE = GangZoneCreate(2505.8362, -1649.8331, 2473.1072, -1687.1586);
// minx miny maxx maxy
// Grove
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!!
EDITED
HOPE U UNDERSTAND
!!
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.
Conclusion
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
WARNING LOOK UP ^ I'LL FIX IT