19.11.2008, 17:31
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:
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]