10.04.2016, 20:28
(
Последний раз редактировалось Darkwood17; 07.05.2016 в 11:53.
)
Hello,
I've created a object (barrier) and a command to move it's rotation only.
The problem is that the barrier immediately goes to position and movement is not seen.
The speed I use is 0.05, I also tried with lower values like 0.005 and 0.0005, but the movements still are unnoticeable or move non-smooth.
Edit: Thanks to adri1
I've created a object (barrier) and a command to move it's rotation only.
The problem is that the barrier immediately goes to position and movement is not seen.
The speed I use is 0.05, I also tried with lower values like 0.005 and 0.0005, but the movements still are unnoticeable or move non-smooth.
Код:
new barrier; // Setup the variable "barrier" new Float:movespeed = 0.05; // Set the move speed of the barrier public OnGameModeInit() { AddPlayerClass(2, 1888.0, 1095.0, 11.0, 0, 0, 0, 0, 0, 0, 0); barrier = CreateObject(968, 1882.5, 1103.2, 10, 0, 0, 0); // Barrier (Opened) return 1; } CMD:barrier(playerid, params[]) { new status; if (sscanf(params, "i", status)) return SendClientMessage(playerid, -1, "0: Open; 1: Close"); if (status == 0) // Open the barrier { MoveObject(barrier, 1882.5, 1103.2, 10, movespeed, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, "~w~The barrier was opened~n~Rotation Y: ~r~0.0", 3000, 3); } if (status == 1) // Close the barrier { MoveObject(barrier, 1882.5, 1103.2, 10, movespeed, 0.0, 90.0, 0.0); // Rotation Y is changed to 90.0 GameTextForPlayer(playerid, "~w~The barrier was closed~n~Rotation Y: ~r~90.0", 3000, 3); } return 1; }