Help for elevator -
skydux123 - 21.03.2015
Hello I need help with elevator
I go into elevator, type command to move, but first move doors then move elevator that is bad?
Please help
Code:
Код:
CMD:liftas(playerid, params[])
{
new Float:pos[3];
GetDynamicObjectPos(elevator, pos[0], pos[1], pos[2]);
if(IsPlayerInRangeOfPoint(playerid, 10.0, pos[0], pos[1], pos[2]))
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Vieћbučio Liftas", "Pasirinkite aukљtą\nApatinis aukљtas\n1 aukљtas\n2 aukљtas\n3 aukљtas\n4 aukљas\nV.I.P aukљtas", "Pasirinkau", "Iљeiti");
}else{
return 0;
}
return 1;
}
Код:
if(dialogid == 5) //Liftas
{
if(response)
{
if(listitem == 0)
{
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_LIST, "Vieћbučio Liftas", "Pasirinkite aukљtą\nApatinis aukљtas\n1 aukљtas\n2 aukљtas\n3 aukљtas\n4 aukљas\nV.I.P aukљtas", "Pasirinkau", "Iљeiti");
}
else if(listitem == 1)
{
luzdarom(14.4996, 1);
GameTextForPlayer(playerid, "~g~Apatinis ~r~aukstas", 1000, 5);
}else if(listitem == 2)
{
luzdarom(18.6406, 2);
GameTextForPlayer(playerid, "~g~Pirmas ~r~aukstas", 1000, 5);
}else if(listitem == 3)
{
luzdarom(23.1406, 3);
GameTextForPlayer(playerid, "~g~Antras ~r~aukstas", 1000, 5);
}else if(listitem == 4)
{
luzdarom(28.6406, 4);
GameTextForPlayer(playerid, "~g~Trecias ~r~aukstas", 1000, 5);
}else if(listitem == 5)
{
luzdarom(33.1406, 5);
GameTextForPlayer(playerid, "~g~Ketvirtas ~r~aukstas", 1000, 5);
}else if(listitem == 6)
{
luzdarom(38.1406, 6);
GameTextForPlayer(playerid, "~g~V.I.P ~r~aukstas", 1000, 5);
}
}
return 1;
}
return 1;
}
Код:
stock latidarom(Float:cord)
{
MoveDynamicObject(durys[0], X_DOOR_L_OPENED, -1808.0271, cord, 3.50);
MoveDynamicObject(durys[1], X_DOOR_R_OPENED, -1808.0271, cord, 3.50);
return 1;
}
stock luzdarom(Float:cord, id)
{
liftoz = cord;
new Float:Pos[3];
GetDynamicObjectPos(durys[0], Pos[0], Pos[1], Pos[2]);
MoveDynamicObject(durys[0], X_DOOR_CLOSED, -1808.0271, cord, 4);
MoveDynamicObject(durys[1], X_DOOR_CLOSED, -1808.0271, cord, 4);
keliamlifta(id);
return 1;
}
Код:
forward luzdarytas();
public luzdarytas()
{
latidarom(liftoz);
}
Код:
stock keliamlifta(id)
{
if(id == 1)
{
MoveDynamicObject(elevator,1365.85901, -1811.87549, 14.4996, 2);
SetTimer("luzdarytas", 4000, false);
}else if(id == 2)
{
SetTimer("luzdarytas", 4000, false);
MoveDynamicObject(elevator,1365.85901, -1811.87549, 18.6406, 2);
}else if(id == 3)
{
SetTimer("luzdarytas", 4000, false);
MoveDynamicObject(elevator,1365.85901, -1811.87549, 23.1406, 2);
}else if(id == 4)
{
SetTimer("luzdarytas", 4000, false);
MoveDynamicObject(elevator,1365.85901, -1811.87549, 28.6406, 2);
}else if(id == 5)
{
SetTimer("luzdarytas", 4000, false);
MoveDynamicObject(elevator,1365.85901, -1811.87549, 33.1406, 2);
}else if(id == 6)
{
SetTimer("luzdarytas", 4000, false);
MoveDynamicObject(elevator,1365.85901, -1811.87549, 38.1406, 2);
}
}
Thanks in advice
Re: Help for elevator -
sheeraz - 31.10.2015
It Moves ?