Camera can be moved
#1

http://*********/WxEZI_7DGzI?t=2m27s
Look this link iin minute 2 and second 27
I want to make the camera to move with mouse like here
Thanks for understand help mee please
Reply
#2

Use this to make some sort of camera movements like shown https://sampforum.blast.hk/showthread.php?tid=330879
Reply
#3

Commonn i dont want this i want to move the camera by the mouse where i want Not like dhad
Reply
#4

Quote:
Originally Posted by Threshold
Посмотреть сообщение
pawn Код:
new cameraobject[MAX_PLAYERS] = -1;

CMD:freeze(playerid, params[])
{
    new Float:x, Float:y, Float:z;
    GetPlayerCameraPos(playerid, x, y, z);
    cameraobject[playerid] = CreateObject(19475, x, y, z, 0.0, 0.0, 0.0); //19475 is an invisible object with no collision
    AttachCameraToObject(playerid, cameraobject[playerid]);
    ApplyAnimation(playerid, "ped", "IDLE_stance", 4.1, 1, 0, 0, 0, 0, 1);
    return 1;
}
CMD:unfreeze(playerid, params[])
{
    ClearAnimations(playerid);
    SetCameraBehindPlayer(playerid);
    DestroyObject(cameraobject[playerid]);
    cameraobject[playerid] = -1;
    return 1;
}
Rather than using TogglePlayerControllable, you can simply apply the idle animation to the player which simulates the same effect that TogglePlayerControllable has. They cannot move and they cannot move their camera, but the camera itself isn't actually frozen..

The two commands above just represent how you would freeze and unfreeze with the functions such as ApplyAnimation and AttachCameraToObject. The cameraobject[playerid] idea is optional, but I recommend it to save yourself from having hundreds of invisible objects scattered across the server without you knowing it, thus freeing up some space for additional objects.

To 'freeze' the player:
pawn Код:
ApplyAnimation(playerid, "ped", "IDLE_stance", 4.1, 1, 0, 0, 0, 0, 1);
To unfreeze the player:
pawn Код:
ClearAnimations(playerid);
To enable camera movement: (This is really only if you want the camera to not be focused on the player)
pawn Код:
cameraobject[playerid] = CreateObject(19475, x, y, z, 0.0, 0.0, 0.0); //19475 is an invisible object with no collision
AttachCameraToObject(playerid, cameraobject[playerid]);
To reset camera movement:
pawn Код:
SetCameraBehindPlayer(playerid);
--

References:
https://sampwiki.blast.hk/wiki/SetCameraBehindPlayer
https://sampwiki.blast.hk/wiki/AttachCameraToObject
https://sampwiki.blast.hk/wiki/ApplyAnimation
https://sampwiki.blast.hk/wiki/ClearAnimations
https://sampwiki.blast.hk/wiki/GetPlayerCameraPos
This is an example of the same thread with the exact same problem... you can replace 'x, y and z' to fit your own coordinates... It is recommended that you keep the player within close range of the camera position. The ApplyAnimation line will 'freeze' the player without freezing the camera.
Reply
#5

I think it's related with this: https://sampwiki.blast.hk/wiki/CameraCutStyles
Reply
#6

Ok ok work but dont hide the Radar In map
Reply
#7

https://sampwiki.blast.hk/wiki/TogglePlayerSpectating
https://sampwiki.blast.hk/wiki/AttachCameraToObject
https://sampwiki.blast.hk/wiki/CreateObject

Example:
pawn Код:
TogglePlayerSpectating(playerid, true);
AttachCameraToObject(playerid, CreateObject(19475, 0, 0, 10, 0.0, 0.0, 0.0));
Will create a movable camera at the coordinates: 0.0, 0.0, 10.0

pawn Код:
TogglePlayerSpectating(playerid, true);
AttachCameraToObject(playerid, CreateObject(19475, x, y, z, 0.0, 0.0, 0.0));
Replace 'x', 'y' and 'z' with your desired coordinates respectively.
Reply
#8

But when i am spectating a vehicle i want to move camera after destroy vehicle
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)