12.02.2011, 09:33
(
Последний раз редактировалось XoX; 12.02.2011 в 11:02.
)
I made a simple function. (I'm using Incognitos streamer btw)
The problem is that the script does not detect the elevator when it's on top (it needs about 9 seconds) so the turrent won't move to the former place. Any help?
Edit solved.
Код:
new Elevator; new Float:ex, Float:ey, Float:ez; new turret; forward Elevatordown(playerid); forward Elevatordetect(playerid);
Код:
Elevator=CreateDynamicObject(2986,269.14230347,1884.15917969,-31.07769585,0.00000000,0.00000000,0.00000000); turret=CreateDynamicObject(7586,268.72607422,1883.99987793,11.20800018,0.00000000,0.00000000,0.00000000);
Код:
CMD:eup(playerid, params[]) { if(IsPlayerLuxAdminLevel(playerid,3)) { new string[256]; new movetime = MoveDynamicObject(Elevator, 269.14230347,1884.15917969, 18.6611, 5.00); MoveDynamicObject(turret, 240.72607422,1883.99987793,9.20800018, 5.00); SetTimer("Elevatordown", 10000, false); SetTimer("Elevatordetect", 20000, false); if (ex == 269.14230347 && ey == 1884.15917969 && ez == 18.6611) { MoveDynamicObject(turret, 268.72607422,1883.99987793,11.20800018, 5.00); return 1; } format(string, sizeof(string), "E1 will finish moving in %d milliseconds", movetime); SendClientMessage(playerid, 0xFF000000, string); return 1; } return 1; }
Код:
public Elevatordown(playerid) { MoveDynamicObject(Elevator, 269.14230347,1884.15917969,-31.07769585, 5.00); return 1; } public Elevatordetect(playerid) { GetDynamicObjectPos(Elevator, ex, ey, ez); return 1; }
Edit solved.
Код:
public Elevatordetect(playerid) { GetDynamicObjectPos(Elevator, ex, ey, ez); if (ex == 269.14230347 && ey == 1884.15917969 && ez == 18.6611) { MoveDynamicObject(turret, 268.72607422,1883.99987793,11.20800018, 5.00); return 1; } }