29.05.2012, 10:24
Hello, I have trying to make it so when you do /door next to a lspd door it will open but when i do /door the doors open but not how they are meant to..... I have done this so many times but it has done the same thing, the rotation of the doors change when they are not meant to and they go way out, then if i do /door again they will go somewhere else, please help me.
Thank You
Please Help Me
pawn Код:
// Top of script
new LSPDDoor1;
//OnGameModeInIt
LSPDDoor1 = CreateDynamicObject(1569,253.19999695,107.59999847,1002.20001221,0.00000000,0.00000000,90.00000000);
command(door, playerid, params[])
{
new string[128];
if(Groups[Player[playerid][Group]][CommandTypes] == 1 || Groups[Player[playerid][Group]][CommandTypes] == 4)
{
GetPlayerPos(playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
GetDynamicObjectPos(LSPDDoor1, Positions[1][0], Positions[1][1], Positions[1][2]);
GetDynamicObjectPos(LSPDDoor2, Positions[2][0], Positions[2][1], Positions[2][2]);
GetDynamicObjectPos(LSPDDoor3, Positions[3][0], Positions[3][1], Positions[3][2]);
if(GetDistance(Positions[0][0], Positions[0][1], Positions[0][2], Positions[1][0], Positions[1][1], Positions[1][2]) < 10.0)
{
if(LSPDDoor1Open == 0)
{
format(string, sizeof(string), "* %s unlocks the door before sliding it open.", GetName(playerid));
NearByMessage(playerid, NICESKY, string);
MoveDynamicObject(LSPDDoor1, 253.19999695,105.19999695,1002.20001221, 1);
LSPDDoor1Open = 1;
}
else
{
format(string, sizeof(string), "* %s slides the doors shut before locking them.", GetName(playerid));
NearByMessage(playerid, NICESKY, string);
MoveDynamicObject(LSPDDoor1, 253.19999695,107.59999847,1002.20001221, 1);
LSPDDoor1Open = 0;
}
}
}
Please Help Me