SA-MP Forums Archive
A problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: A problem (/showthread.php?tid=73027)



A problem - SpiderPork - 12.04.2009

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.


Re: A problem - MenaceX^ - 12.04.2009

You need to work with SetCameraPlayerPos aswell.


Re: A problem - SpiderPork - 12.04.2009

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