SA-MP Forums Archive
GetObjectPos, SetPlayerCamerPos - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: GetObjectPos, SetPlayerCamerPos (/showthread.php?tid=288467)



GetObjectPos, SetPlayerCamerPos - System64 - 07.10.2011

well, I'm here with new problem xD
I got object that I spawn with /uavstart
And when I do /uavcontrol it should set camera on the object, so I look from air, bird perspective, but it doesn't do it :S
pawn Код:
new Float: Pos[4], Float: OPos[4], uavobj, UAVObject = 0, bool: UAVStarted;
YCMD:uavcontrol(playerid, params[], help)
{
    #pragma unused help
    #pragma unused params
    if(UAVStarted == false) return SendClientMessage(playerid, 0xFF0000FF, "You didn't started UAV!");
    TogglePlayerControllable(playerid, 0);
    GetObjectPos(uavobj, OPos[0], OPos[1], OPos[2]);
    SetPlayerCameraPos(playerid, OPos[0], OPos[1], OPos[2]);
    GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
    SetPlayerCameraLookAt(playerid, OPos[0], OPos[1], OPos[2]);
    SendClientMessage(playerid, 0x10F441AA, "You have started controlling the UAV!");
    return 1;
}



Re: GetObjectPos, SetPlayerCamerPos - [MWR]Blood - 07.10.2011

Set the Z coordinate to a bit more - like + 20 - 25!


Re: GetObjectPos, SetPlayerCamerPos - Zh3r0 - 07.10.2011

pawn Код:
SetPlayerCameraPos(playerid, OPos[0], OPos[1], OPos[2] + (30));
Choose the distance you want.


Re: GetObjectPos, SetPlayerCamerPos - DRIFT_HUNTER - 07.10.2011

pawn Код:
TogglePlayerSpectating(playerid, true);



Re: GetObjectPos, SetPlayerCamerPos - System64 - 07.10.2011

Ok guys, gonna try it latter, thanks