Set a players camera inside them?
#1

im trying to set a players camera so they don't see themselves, maybe a little infront of them but im doing it like
pawn Code:
public OnPlayerUpdate(playerid)
{
    new Float:x, Float:y, Float:z; /*, Float:cx, Float:cy, Float:cz*/
    GetPlayerPos(playerid, x, y, z);
    SetPlayerCameraPos(playerid, x, y, z);
    //GetPlayerCameraFrontVector(playerid, cx, cy, cz);
    //SetPlayerCameraLookAt(playerid, cx, cy, cz);
    return 1;
}
and it is not changing anything at all, will i need to add values to the x, y and z or what?
Reply
#2

Try some different way of setting the camera, i'm not sure you could calculate it with the player postions somewhere. OnPlayerRequestClass might work.

sorry if i don't make sense
Reply
#3

Sure, one command:

pawn Code:
PutCameraInAnus(playerid);
That's a joke. You could use this function and perhaps reverse the coordinates:

pawn Code:
stock SetPlayerCameraInFrontOfPlayer(playerid, Float:distance, Float:heightoffset) // iPLEOMAX
{
    new Float:P[3];
    GetPlayerPos(playerid, P[0], P[1], P[2]);
    SetPlayerCameraLookAt(playerid, P[0], P[1], P[2]);
    GetXYInFrontOfPlayer(playerid, P[0], P[1], distance);
    SetPlayerCameraPos(playerid, P[0], P[1], P[2]+heightoffset);
}

stock GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
{                                                 // Created by Y_Less
    new Float:a;
    GetPlayerPos(playerid, x, y, a);
    GetPlayerFacingAngle(playerid, a);
    if (GetPlayerVehicleID(playerid)) { GetVehicleZAngle(GetPlayerVehicleID(playerid), a); }
    x += (distance * floatsin(-a, degrees));
    y += (distance * floatcos(-a, degrees));
}
Reply
#4

I'll try adapting that code RealCop228, and if it doesn't work ill try the first code you gave xD. also, when i used the SetPlayerCameraLookAt, it wouldn't let me look around with the mouse, possibly because it was updating so much.

and @linuxthefish, I get what you mean, but this whole game mode i don't want the user to even see the player skin, kind of like first person.

This is going to end up being like a flying camera, god like thing, so i need to be able to move the camera to look. all the player movements will be server sided.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)