A problem
#1

Hello!

A few minutes ago I started a new script. And now I wonder if this is wrong-wrotten or bugged.
It'd have to set the player's camera to look behind his vehicle.

pawn Код:
if(ispassenger)
{
    Variable1[playerid] = vehicleid;
    new Float:X, Float:Y, Float:Z, Float:behindX, Float:behindY;
    GetVehiclePos(vehicleid, X, Y, Z);
    GetXYBehindVehicle(RearGunnerVeh[playerid], behindX, behindY, 10.0);
    SetPlayerPos(playerid, X, Y, Z);
    SetPlayerCameraLookAt(playerid, behindX, behindY, Z);
    Variable2[playerid] = 1;
    SendClientMessage(playerid, LIGHTBLUE, "Hold tight!");
    SendClientMessage(playerid, YELLOW, "Press vehicle enter/exit key to exit the rear gunner position!");
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4);
    Wut = SetTimerEx("Wuteva", 500, true, "i", playerid);
}
It compiles with no errors, but when I try it ingame, it sets the camera to a weird place.
Reply
#2

You need to work with SetCameraPlayerPos aswell.
Reply
#3

Uh... I accidentally wrote SetPlayerPos instead of SetPlayerCameraPos in the script...
Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)