[Include] [INC] NCF aka New Camera Functions by Leopard
#1

NCF - New Camera Functions v1.1
by Leopard
_________________________________________________
What's that?
It's an include to extend your camera functions.
_________________________________________________
Why?
http://forum.sa-mp.com/index.php?top...0494#msg510494
_________________________________________________
How?
Mainly using objects. IMPORTANT!: Using objects, so if your player's are crashing, blame the objects. Your decision. But the chance to crash is 20%, according to me.
The object is invisible, so you don't see it.
_________________________________________________
What's the functions?
- SetCameraPosForPlayer
- SetCameraLookAtForPlayer
- MoveCameraPosForPlayer
- MoveCameraLookAtForPlayer
- ResetCameraForPlayer
- ShakeCameraForPlayer
- SetCameraFollowPlayerForPlayer
- SetCameraFollowVehicleForPlayer

All also with a -ForAll extension.

IMPORTANT! 2: You SHOULD (not using it might cause some problems)
use the SetCameraLookAtFor(all/player) BEFORE SetCameraPosFor(all/player).
IMPORTANT! 3: You MUST place "Camera_Join(playerid)" in OnPlayerConnect. (notice without an ';' ) The same with "Camera_Leave(playerid)".

- All forwards:
pawn Code:
// Forwards..
forward MoveCameraPosForPlayer(playerid, Float:x, Float:y, Float:z, Float:speed);
forward MoveCameraLookAtForPlayer(playerid, Float:x, Float:y, Float:z, Float:speed);
forward SetCameraPosForPlayer(playerid, Float:x, Float:y, Float:z);
forward SetCameraLookAtForPlayer(playerid, Float:x, Float:y, Float:z);
forward ResetCameraForPlayer(playerid);
forward ShakeCameraForPlayer(playerid, time, speed, intense);
forward SetCameraFollowPlayerForPlayer(playerid, id, time);
forward SetCameraFollowVehicleForPlayer(playerid, vehicleid, time);

// "-Get" Forwards...
forward GetCameraPos(playerid, &Float:x, &Float:y, &Float:z);
forward GetCameraLookAt(playerid, &Float:x, &Float:y, &Float:z);
forward GetCameraSpeed(playerid, &speed);

// "-Is" Forwards...
forward IsPlayerCameraMoving(playerid);
forward IsCameraPosInvalid(playerid);
forward IsCameraLookAtInvalid(playerid)

// Other forwards..
forward CameraUpdate(playerid);
forward KillShake(playerid);
forward ShakeTimer(playerid, speed, intense);
forward Float:GetAngle(Float:x, Float:y, Float:ix, Float:iy);
forward KillFollow(playerid);
forward Follow(playerid, id);forward KillFollow(playerid);
forward Follow(playerid, id);

// Loopings
forward MoveCameraPosForAll(Float:x, Float:y, Float:z, speed);
forward MoveCameraLookAtForAll(Float:x, Float:y, Float:z, speed);
forward SetCameraPosForAll(Float:x, Float:y, Float:z);
forward SetCameraLookAtForAll(Float:x, Float:y, Float:z);
forward ResetCameraForAll();
forward ShakeCameraForAll(time, speed, speed_between_next_shake);
forward SetCameraFollowPlayerForAll(id, time);
forward SetCameraFollowVehicleForAll(vehicleid, time);

_________________________________________________
Where's the download link?
The INCLUDE: a_cam.inc
An example FS to test: movecam.pwn
All-in-one-package-ready-to-use: movecam.amx
_________________________________________________
How to use it?
If you are using INCLUDE:
Put the include in \pawno\includes\. Put then "#include <a_cam>" on top of your script. Then use the desired functions.
If you are using testing FS:
Put the FS in "filterscripts" folder. Compile it. Then login to RCON (/rcon login urpass), then load the FS (/rcon loadfs movecam).
If you are using "All-in-one-package-ready-to-use":
Place the FS Inside "filterscripts" folder. Log in to RCON (/rcon login yourpassword), then load the FS (/rcon loadfs movecam).
_________________________________________________
Preview
NCF - New Camera Functions - by Leopard
_________________________________________________
BUGS?
PM Me or reply to this topic.
_________________________________________________
What's planned in the next version?
Want to have a new cam function?
Reply and i'll see if i can create it.
_________________________________________________
[b]Enjoy![b]
Reply
#2

Nice I need to try this

btw, does MovePlayerCamera move it slowly like MoveObject or in one movement like SetObjectPos?
Reply
#3

Quote:
Originally Posted by Yaheli
Nice I need to try this

btw, does MovePlayerCamera move it slowly like MoveObject or in one movement like SetObjectPos?
It's like MoveObject.
Oh, i forgot to mention that, there are 3 different types - SLOW_SPEED, MEDIUM_SPEED and FAST_SPEED.
Reply
#4

Quote:
Originally Posted by [K4L
Leopard ]
Quote:
Originally Posted by Yaheli
Nice I need to try this

btw, does MovePlayerCamera move it slowly like MoveObject or in one movement like SetObjectPos?
It's like MoveObject.
Oh, i forgot to mention that, there are 3 different types - SLOW_SPEED, MEDIUM_SPEED and FAST_SPEED.
Really great! Special the MoveCameraForPlayer function!

Good job!
Reply
#5

I should try this
Reply
#6

Nice work, this is usefull! (:
Reply
#7

He's using moveobject as an example, it moves smoothly it doesnt set it to a position, it actually moves there.
Reply
#8

Nice, but can you not make it so we can enter our own speeds like, 1.7, 1.2, not SPEED_SLOW etc..
Reply
#9

Quote:
Originally Posted by Seif_
I don't get it... From what I see in MoveCameraForPlayer, it just moves the object. What's the use of the object if it's the camera that's suppose to move?
Yes, it moves the object, and the camera position follows it.

Quote:
Originally Posted by iMatt™
He's using moveobject as an example, it moves smoothly it doesnt set it to a position, it actually moves there.
Exactly.

Quote:
Originally Posted by Norn
Nice, but can you not make it so we can enter our own speeds like, 1.7, 1.2, not SPEED_SLOW etc..
You can, but not float i'm afraid.
Reply
#10

First of all,If you want people to download this,You should Put some screenshots,
Maybe you got but,i couldnt see.

2nd,I am using your based camera but,I have added some few things for it.
Like,A job for one guy who can sit down,and watch everything.
and notice it. 'true'==0

And i've added that i can turn the camera Left/Right as i wish.

If you would like i can reupload the deluxed one.

Or you can add this things,its cool.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)