18/03/2022 10:18
Código PHP:
// Part 1
new Float:x[2], Float:y[2], Float:z;
GetXYInFrontOfPlayer(playerid, 1.5, x[0], y[0]);
GetPlayerPos(playerid, x[1], y[1], z);
new obj = CreateObject(1238, x[0], y[0], (z + 1.0));
SetPlayerCameraPos(playerid, x[1], y[1], (z + 1.0));
SetPlayerCameraLookAt(playerid, x[0], y[0], (z + 1.0));
SetTimerEx("GirarObj", 1000, 0, "d", obj);
// Part 2
forward GirarObj(objectid);
public GirarObj(objectid)
{
if(IsValidObject(objectid))
{
new Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz;
GetObjectPos(objectid, x, y, z);
GetObjectRot(objectid, rx, ry, rz);
MoveObject(objectid, x, y, z, 45.0, rx, ry, (rz + 45.0));
SetTimerEx("GirarObj", 1000, 0, "d", objectid);
}
return 1;
}