Problem MTA Pawno -
Steeve_Smith - 06.07.2011
Hey guys!
I followed [ame=http://www.youtube.com/watch?v=E_aO0Bp64I4&feature=related]this[/ame] tutorial but I got some problems:
I created the first gate, I saved, then I created the second gate, I saved (the first one is on the road and the second one on the green to allow the guy who typed /open to pass).
Here is the pic of the first gate:
But both gates have the same Location... I don't know why, but when I converted the code on convertfss, the location of the first gate was the same as the second one... Look the pic, I opened the gate and it didn't move:
So why does MTA keep the same location for both gates? Normally it should not, so what's wrong?
Edit: I am
sure that I took locations in both files, but they were same..
Edit: Here is all the code related to the movable gates:
Код:
new gate;
public OnGameModeInit()
{
gate = CreateObject(969,2464.58935547,-1663.40649414,12.30931187,0.00000000,0.00000000,89.75000000);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext, "/open", true) == 0)
{
MoveObject(gate,2464.58935547,-1663.40649414,12.30931187, 1); // The gate is going left
SendClientMessage(playerid, 0x00FFFFFF, "Portail ouvert!");
return 1;
}
if(strcmp(cmdtext, "/close", true) == 0)
{
MoveObject(gate,2464.58935547,-1663.40649414,12.30931187, 1); // The gate is going right
SendClientMessage(playerid, 0x00FFFFFF, "Portail fermй!");
return 1;
}
return 0;
}
Anyway the PAWNO's code is right.
Re : Problem MTA Pawno -
Steeve_Smith - 07.07.2011
Up
Re: Problem MTA Pawno -
Wesley221 - 07.07.2011
Take a look at the coцrds. They both are the same, so it wont move in any way.
Re : Problem MTA Pawno -
Steeve_Smith - 07.07.2011
Yes, I saw the coords are same, and that is the problem, because even if I save the first gate, I moved and saved the second one but it has the same coords as the first one! Whereas it logically shouldn't. o.o
Re: Problem MTA Pawno -
Genious - 07.07.2011
Change coords in the way you want it
Re: Problem MTA Pawno -
Babul - 07.07.2011
you are facing east, and want the gate moving south? thats achieved by subtracting a value like 5, maybe 6, from the second coordinate:
2464.58935547,-1663.40649414,12.30931187
becomes
2464.58935547,-1669.40649414,12.30931187
for the gate rolledon the gras...
Re : Problem MTA Pawno -
Steeve_Smith - 07.07.2011
Genious: I know that I may change coords, but MTA save only the coord of the first gate.. And even if I start a new one or delete the first gate to get coords of the second, I won't know where to place it!
Babul: Thanks, it works, then the -1669 Coords will be the "closed gate" and the -1663 will be the openned gate, and by replacing by something like 10 it should be perfect! Thanks!
Anyway don't know why MTA bugs like this :/
Re : Problem MTA Pawno -
Steeve_Smith - 07.07.2011
Ok guys, I found what was wrong with MTA, look at this:
Before saving:
After saving and re-opening:
Why it doesn't save like in Pic 1?
Re: Problem MTA Pawno -
whitedragon - 07.07.2011
angle is wrong in picture
Re : Problem MTA Pawno -
Steeve_Smith - 07.07.2011
Ok fixed, the problem was that I didn't double click on the object before saving and so, the angle was maybe wrong. After double clicking on the item and pressing "Ok" it saves all the items coords (including angle) and so it now works!
Thanks guys!