SA-MP Forums Archive
[help] MoveObject - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [help] MoveObject (/showthread.php?tid=298448)



[help] MoveObject - NickSoon - 20.11.2011

Version : 0.3c

Problem : I am trying to open the orange-white gate and its wont open to me
like i am want. I mean, I want the gate to open like that :
|
|
But its wont do it like that, its just takes it up few milimiters up and thats it.
[the gate is like that : ___ ]

OnGameModeInit :

Quote:

//CreateObject(968, -1701.5, 687.59997558594, 24.89999961853, 0, 0, 96);
pdgate2 = CreateObject(968, -1701.4000244141, 687.70001220703, 24.700000762939, 0, 90, 270.00051879883);

the command itself :

Quote:

if(strcmp(cmd, "/pdgateo2", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if (PlayerToPoint(8, playerid,-1701.5, 687.59997558594, 24.89999961853) || PlayerToPoint(3,playerid,-1701.5, 687.59997558594, 24.89999961853) || PlayerInfo[playerid][pLocal] != 255)
{
format(string, sizeof(string), "* Officer %s click on the remote control and open the gate", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
MoveObject(pdgate2, -1701.5, 687.59997558594, 24.89999961853, 5);
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD1, " You are not a Cop !");
}
}
return 1;
}

Pictures :

Before : http://www.fastup.co.il/images/16127556.bmp
After : http://www.fastup.co.il/thumbs/62406401.bmp

What can I do for fix it..
Please help.

Thanks,
NickSoon.
[sorry for lame english.]


Re: [help] MoveObject - Calgon - 21.11.2011

You need to get the coordinates for the object when the gate is supposed to be up. I can't test those coordinates right now, but I presume your problem stems from the fact that you didn't get the correct coordinates.

You should be able to use this filterscript - move the gate so it's up and then save the coordinates of it in that position and replace your MoveObject() coordinates with the ones you get through the filterscript.