19.04.2012, 06:07
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:
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.
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;