24.05.2014, 08:50
I'm not that good at this stuff (floatsin, floatcos). How to set the camera of a player above an object?
command(test, playerid, params[]) {
#pragma unused params
new testobj = CreateObject(2942, 2045.48096, -1921.07983, 12.86420, 0.00000, 0.00000, 90.00000);
AttachCameraToObject(playerid, testobj);
SetTimerEx("MoveCamera", 500, true, "ii", playerid, testobj);
return 1;
}
Func: MoveCamera(playerid, obj) {
new
Float: X, Float: Y, Float: Z;
GetObjectPos(obj, X, Y, Z);
SetPlayerCameraPos(playerid, X, Y, Z + 2.0);
AttachCameraToObject(playerid, obj);
return 1;
}