InCar Camera View...
#1

Is this possible? I mean when you enter in the car it automatically switch the camera to incar view....And if its possible, on what way, i mean how can i do that. I just don't have idea on what way to do that.
Is there any CameraFollowPlayer or SetPlayerCameraPosThenFollow function?
Reply
#2

Make a timer with interval of 50 ms. and put "setplayercamerapos" inside it
Reply
#3

I dont get it..i place SetPlayerCameraPos in car and then SetCameraFacingAngle, but how i can make that camera follow the car

-EDIT- I got an idea..
Reply
#4

Like i said, use a timer
Reply
#5

Let me do something..gonna check
Reply
#6

Doesn't work...can someone make a quick script for this?
Reply
#7

pawn Код:
public UpdateCarCamera()
{
    for(new i=0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInAnyVehicle(i))
            {
                new vehicleid = GetPlayerVehicleID(i);
                new Float:x, Float:y, Float:z, Float:angle;
                GetVehiclePos(vehicleid, x, y, z);
                z += 0.5;
                SetPlayerCameraPos(i, x, y, z);
                GetVehicleZAngle(vehicleid, angle);
                x += floatsin(-angle, degrees);
                y += floatcos(-angle, degrees);
                SetPlayerCameraLookAt(i, x, y, z);
            }
        }
    }
}
pawn Код:
SetTimer("UpdateCarCamera", 100, true);
Reply
#8

is it just me or its not working...let me check...but when i put it then commands aren't working...any of them.
Reply
#9

Put the SetTimer in OnGameModeInit.
Reply
#10

Its working. But lags like a shit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)