01.08.2016, 17:15
Use MoveObject and MoveDynamicObject: https://sampwiki.blast.hk/wiki/MoveObject
Here's a quick example, hope it works:
If you use CreateDynamicObject use MoveDynamicObject, if you use CreateObject use MoveObject.
Here's a quick example, hope it works:
Код:
new gatemoved =0; CMD:gate(playerid, params[]) { if (IsPlayerInRangeOfPoint(playerid, 20.0, -113.3937, 1666.2185, 17.9398)) { if(gatemoved== 0) { SendClientMessage(playerid, -1, "Gate opened."); MoveDynamicObject(gate1, -98.1134, 1665.4869, 17.6971, 3); // Replace the coordinates and the object you want to move, in this case gate1 gatemoved = 1; } else { SendClientMessage(playerid, -1, "Gate closed."); MoveDynamicObject(gate1, -104.77339,1665.48694,17.69710, 3); gatemoved = 0; } } return 1; }