03.09.2014, 11:10
Introduction
Hello guys. I will show you tutorial on how to put your map, after converting in your server + how to create gates with two commands [/open and /close]. I know there is many tutorials like this but i will try to explain it a little better because i am new at scripting so i know what were my mistakes and probably of most new scripters.
So let's get started...
Starting
Ok so first of all enter pawno and select "New". Right lick now and press on "Select all" and then delete it. Now put this at top of script:
You can also put it like this:
It doesn't really matter.
Now if you are creating gates put this below:
Now if you are creating more gates it should look like this:
Never put same name for two gates or objects because it will return this error:
Adding objects to map
So now we are creating objects you converted.
Below
put this:
So below that you put codes. I will put part of code from one of my maps. It should like like this:
If you are creating gates don't put it in codes above.
Create it like this:
And just finish it with this:
If you are not removing map objects or gates put
below.
So now you are done if you are not creating gates. This is how it should look:
If you are creating gates move on...
Adding gate commands
So you are done with creating objects now let's create command for gates.
First of all you don't put this
yet.
First of all under
Put this:
And now let's create command to open gate. Under that ^^^ put this:
So now we got command. But it doesn't do anything yet. Let's make this command to move gates. Under that ^^^ put this:
Now let me explain you. Where you see "gate" there you have to put name of your gates. Name you putted on top after "new". First number (2116.7000000) is X coordinate, second one (3526.0000000) is Y coordinate and third one (0.0000000) is Z coordinate.
Note: This command opens gate so you got to change Z coordinate. Depens do you want gate to go up or down. You can change X or Y if you want gates to go left/right. Which one you have to change depens on your gate's rotation. 4th number (5.00) is speed of gates moving. I use 5 because it isn't too slow or too fast.
Now let's get back to this code for a second:
You got gateid first number, second three numbers are location on map, coordinates. Now last three numbers are rotation of object. While all three numbers are 0.000 you don't have to do anything. But if they have some rotation like these:
That means gate are rotated so you have to change this command from this:
to this:
Note: Rotation coordinates have to be last! It must be like this:
So let's close the gates now. Again, first create the command
Then make command move gates:
Or if you have rotation like these:
Note: Your Z coordinate must be closed gates. Or if you changed X or Y coordinate they must be closed too!
This is how it should look:
HOPE YOU LIKE IT AND YOU CAN UNDERSTAND EVERYTHING
If you don't understand something or need any help ask me, it will be my pleasure to help!
Hello guys. I will show you tutorial on how to put your map, after converting in your server + how to create gates with two commands [/open and /close]. I know there is many tutorials like this but i will try to explain it a little better because i am new at scripting so i know what were my mistakes and probably of most new scripters.
So let's get started...
Starting
Ok so first of all enter pawno and select "New". Right lick now and press on "Select all" and then delete it. Now put this at top of script:
pawn Код:
#include a_samp
pawn Код:
#include <a_samp>
Now if you are creating gates put this below:
pawn Код:
new gate; //replace "gate" with some other name if you want but then you will have to replace it in few other locations
pawn Код:
new gate;
new gate2;
new gate3;
pawn Код:
error 021: symbol already defined: "gate"
Adding objects to map
So now we are creating objects you converted.
Below
pawn Код:
new gate;
pawn Код:
public OnFilterScriptInit()
{
pawn Код:
public OnFilterScriptInit()
{
CreateObject(8172,2055.8000000,3606.3999000,7.2000000,0.0000000,0.0000000,0.0000000);
CreateObject(8172,2095.6001000,3606.5000000,7.2000000,0.0000000,0.0000000,0.0000000);
CreateObject(8172,2135.4004000,3606.6006000,7.2000000,0.0000000,0.0000000,0.0000000);
CreateObject(8172,2175.3000000,3606.7000000,7.2000000,0.0000000,0.0000000,0.0000000);
Create it like this:
pawn Код:
gate = CreateObject(987,2116.7000000,3526.0000000,7.2000000,0.0000000,0.0000000,0.0000000);
pawn Код:
return 1;
}
pawn Код:
return 0;
}
So now you are done if you are not creating gates. This is how it should look:
pawn Код:
#include a_samp
public OnFilterScriptInit()
{
CreateObject(8172,2055.8000000,3606.3999000,7.2000000,0.0000000,0.0000000,0.0000000);
CreateObject(8172,2095.6001000,3606.5000000,7.2000000,0.0000000,0.0000000,0.0000000);
CreateObject(8172,2135.4004000,3606.6006000,7.2000000,0.0000000,0.0000000,0.0000000);
CreateObject(8172,2175.3000000,3606.7000000,7.2000000,0.0000000,0.0000000,0.0000000);
return 1;
}
return 0;
}
Adding gate commands
So you are done with creating objects now let's create command for gates.
First of all you don't put this
pawn Код:
return 0;
}
First of all under
pawn Код:
return 1;
}
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
pawn Код:
if(strcmp(cmdtext,"/YOURCOMMAND",true)==0)//gatesopen
{
pawn Код:
MoveObject(gate, 2116.7000000,3526.0000000,0.0000000, 5.00);
return 1;
}
Note: This command opens gate so you got to change Z coordinate. Depens do you want gate to go up or down. You can change X or Y if you want gates to go left/right. Which one you have to change depens on your gate's rotation. 4th number (5.00) is speed of gates moving. I use 5 because it isn't too slow or too fast.
Now let's get back to this code for a second:
pawn Код:
gate = CreateObject(987,2116.7000000,3526.0000000,7.2000000,0.0000000,0.0000000,0.0000000);
pawn Код:
gate = CreateObject(987,2116.7000000,3526.0000000,7.2000000,0.0000000,0.0000000,90.0000000);
pawn Код:
MoveObject(gate, 2116.7000000,3526.0000000,0.0000000, 5.00);
pawn Код:
MoveObject(gate, 2116.7000000,3526.0000000,0.0000000, 5.00, 0.0000000,0.0000000,90.0000000);
pawn Код:
MoveObject(gateid, X, Y, Z, speed, RotX, RotY, RotZ);
pawn Код:
if(strcmp(cmdtext,"/YOURCOMMAND",true)==0)//gatesclosed
{
pawn Код:
MoveObject(gate, 2116.7000000,3526.0000000,7.2000000, 5.00);
return 1;
}
pawn Код:
MoveObject(gate, 2116.7000000,3526.0000000,7.2000000, 5.00, 0.0000000,0.0000000,90.0000000);
This is how it should look:
pawn Код:
#include a_samp
new gate;
public OnFilterScriptInit()
{
//Your objects here
gate = CreateObject(987,2116.7000000,3526.0000000,7.2000000,0.0000000,0.0000000,0.0000000); //Your coordinates here
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext,"/YOURCOMMAND",true)==0)//gatesopen
{
MoveObject(gate, 2116.7000000,3526.0000000,0.0000000, 5.00);
return 1;
}
if(strcmp(cmdtext,"/YOURCOMMAND",true)==0)//gatesclosed1
{
MoveObject(gate, 2116.7000000,3526.0000000,7.2000000, 5.00);
return 1;
}
return 0;
}
If you don't understand something or need any help ask me, it will be my pleasure to help!