GetPlayerCameraFrontVector Problems
#1

I'm having problems with GetPlayerCameraFrontVector, from my understanding it's meant to get the position that the players camera is facing. Although it isn't doing that for me. Here's the code:

pawn Код:
tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_WHITE, "USAGE: /debug savecamera [single space comment]");
                return 1;
            }
            GetPlayerCameraFrontVector(playerid, pX, pY, pZ);
            GetPlayerCameraPos(playerid, pX2, pY2, pZ2);
            new File: file=fopen("debug.txt", io_append);
            format(string3, sizeof(string3), "SetPlayerCameraPos(playerid, %f, %f, %f);\r\nSetPlayerCameraLookAt(playerid, %f, %f, %f);  // %s \r\n\r\n", pX2, pY2, pZ2, pX, pY, pZ, tmp);
            fwrite(file, string3);
            fclose(file);
            SendClientMessage(playerid, COLOR_LIGHTRED, "DEBUG: You have saved your players Camera Vector Front LookAt.");
            return 1;
When I use the code it saves (SetPlayerCameraPos & SetPlayerCameraLookAt) it's not setting it to the right position. Instead it sets it to the players back vector, not the front.
Reply
#2

Use my SetCameraInFrontOfPlayer function.

You can find it here: https://sampforum.blast.hk/showthread.php?tid=326221.
Reply
#3

Quote:
Originally Posted by TheLazySloth
Посмотреть сообщение
Use my SetCameraInFrontOfPlayer function.

You can find it here: https://sampforum.blast.hk/showthread.php?tid=326221.
That doesn't do what I want. I actually need to get the players camera position look at and then use that to set it later on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)