SA-MP Forums Archive
SetCameraBehindPlayer - 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: SetCameraBehindPlayer (/showthread.php?tid=278874)



SetCameraBehindPlayer - Gazmull - 24.08.2011

I'm having problem with this function, while others don't.

pawn Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(PRESSED(KEY_FIRE))
    {
        if(dOnline[playerid])
        {
            GameTextForPlayer(playerid, "~g~ETA 5 Seconds", 2000, 5);
            SetCameraBehindPlayer(playerid);
            SetTimer("Execute", 5000, false);
        }
    }
    return 1;
}
I dunno if i'm doing wrong, the problem is when i click KEY_FIRE, SetCameraBehindPlayer didn't do anything except for the timer and gametext4player.

EDIT:
Continuation... SetCameraBehindPlayer don't function to go at player's back, it stays on its camera position (SetPlayerCameraPos and SetPlayerCameraLookAt).


Re: SetCameraBehindPlayer - antonio112 - 24.08.2011

How about setting the camera behind the player in the "Execute" function? Or is that too late?

EDIT: Here's the SetCameraBehindPlayer function from WIKI:

Code:
Restore the camera to a place behind the player, after using a function like SetPlayerCameraPos.
https://sampwiki.blast.hk/wiki/SetCameraBehindPlayer


Re: SetCameraBehindPlayer - Gazmull - 24.08.2011

There is no SetCameraBehindPlayer in Execute, it isn't late too.
Nevermind, i fixed her.