Need help with camerapos and lookat
#1

Hi guyz,

I need help, how can I found coords of this CameraPos and CameraLookAt. Here is the pic:

http://imgur.com/rE8ByW9

Thank you for help.
Reply
#2

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

try
Reply
#3

Nope, it's not. I want the coords to set CameraPos and LookAt to be like on the picture.
Reply
#4

pawn Код:
CMD:dsave(playerid, params[])
{
    if(gIsPlayerDead[playerid]) return 1;
   
    new swhat[12], string[126], desc[126], Float:X, Float:Y, Float:Z, Float:A, vw = GetPlayerVirtualWorld(playerid), interior = GetPlayerInterior(playerid);
    if(sscanf(params, "s[12]s[126]", swhat, desc)) return SendClientMessage(playerid, -1, "DEBUG: /dsave [position / camera] [description]");

    if(strcmp(swhat, "position", true) == 0)
    {
        if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER || GetPlayerState(playerid) == PLAYER_STATE_PASSENGER)
        {
            new File:fdebug = fopen("debug.txt", io_append);
            new vehicleid = GetPlayerVehicleID(playerid);
            GetVehiclePos(vehicleid, X, Y, Z);
            GetVehicleZAngle(vehicleid, A);
            format(string, sizeof(string), "VEHICLE POSITION: %f, %f, %f, %f // %s\r\n", X, Y, Z, A, desc);
            fwrite(fdebug, string);
            fclose(fdebug);
            SendClientMessage(playerid, -1, "DEBUG: Your vehicles position has been saved to debug.txt");
            return 1;
        }
        else if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
        {
            new File:fdebug = fopen("debug.txt", io_append);
            GetPlayerPos(playerid, X, Y, Z);
            GetPlayerFacingAngle(playerid, A);
            format(string, sizeof(string), "ON FOOT POSITION: %f, %f, %f, %f, %d, %d // %s\r\n", X, Y, Z, A, vw, interior, desc);
            fwrite(fdebug, string);
            fclose(fdebug);
            SendClientMessage(playerid, -1, "DEBUG: Your on-foot position has been saved to debug.txt");
            return 1;
        }
        else
        {
            SendClientMessage(playerid, -1, "DEBUG: You are not on-foot or in any vehicle.");
            return 1;
        }
    }
    else if(strcmp(swhat, "camera", true) == 0)
    {
        new File:fdebug = fopen("debug.txt", io_append);
        new Float: x2, Float: y2, Float: z2, Float:x3, Float: y3, Float:z3;
        GetPlayerCameraPos(playerid, X, Y, Z);
        GetPlayerCameraFrontVector(playerid, x2, y2, z2);
        format(string, sizeof(string), "CAMERA POSITION: %f, %f, %f // %s\r\n", X, Y, Z, desc);
        fwrite(fdebug, string);
        const Float:fScale = 1.0;
        x3 = X + floatmul(x2, fScale);
        y3 = Y + floatmul(y2, fScale);
        z3 = Z + floatmul(z2, fScale);
        format(string, sizeof(string), "CAMERA LOOKAT: %f, %f, %f // %s\r\n", x3, y3, z3, desc);
        fwrite(fdebug, string);
        fclose(fdebug);
        SendClientMessage(playerid, -1, "DEBUG: Your camera position and lookat has been saved.");
        return 1;
    }
    else
    {
        SendClientMessage(playerid, -1, "DEBUG: /dsave [position / camera] [description]");
    }
    return 1;
}
Then do /dsave camera [description], it saves in /scriptfiles/debug.txt

Note: That command is just from my script and has some of my variables, the camera bit you're looking for is:
pawn Код:
new File:fdebug = fopen("debug.txt", io_append);
        new Float: x2, Float: y2, Float: z2, Float:x3, Float: y3, Float:z3;
        GetPlayerCameraPos(playerid, X, Y, Z);
        GetPlayerCameraFrontVector(playerid, x2, y2, z2);
        format(string, sizeof(string), "CAMERA POSITION: %f, %f, %f // %s\r\n", X, Y, Z, desc);
        fwrite(fdebug, string);
        const Float:fScale = 1.0;
        x3 = X + floatmul(x2, fScale);
        y3 = Y + floatmul(y2, fScale);
        z3 = Z + floatmul(z2, fScale);
        format(string, sizeof(string), "CAMERA LOOKAT: %f, %f, %f // %s\r\n", x3, y3, z3, desc);
        fwrite(fdebug, string);
        fclose(fdebug);
        SendClientMessage(playerid, -1, "DEBUG: Your camera position and lookat has been saved.");
Reply
#5

I got
Код:
CAMERA POSITION: 0.000000, 0.000000, 0.000000 // aha
CAMERA LOOKAT: -0.000000, 0.000000, 0.000000 // aha
Still not, any other help? Thank you both for answering and trying to help.
Reply
#6

Quote:
Originally Posted by SpartanacBH
Посмотреть сообщение
I got
Код:
CAMERA POSITION: 0.000000, 0.000000, 0.000000 // aha
CAMERA LOOKAT: -0.000000, 0.000000, 0.000000 // aha
Still not, any other help? Thank you both for answering and trying to help.
Show me the code you created with what I gave you?
Reply
#7

I used Ur command, but it didn't helped me. I still dunno what I need for this.
Reply
#8

Show me the exact command you're using, you must of changed something, because it works perfectly fine for me.
Reply
#9

I just changed from ZCMD to YCMD, that's all.
Reply
#10

Just post it, mine work's perfectly, so show me what you ended up with.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)