[FilterScript] Firstperson for Cars
#1

Heya Guys its me again with a new unique feature that i want to share with you.
As im also working on an Onfoot Firstperson Camera i was making one for cars.
Well here it is have fun with it:
Pastebin:
http://pastebin.com/JPAznSer

*******:
http://www.youtube.com/watch?v=wC1qx...ature=*********

No bugs so far known
I would like to get some feetback

Enjoy
Reply
#2

Awesome Driving Skills and FS!
Reply
#3

You need to have a list of offsets for different cars for example...

Код:
new enum VehicleOffsetData { vOffX, vOffY, vOFFz, vOFFRX, vOFFRY, vOFFRZ, bool:vUseOffset }
stock const vOffSets[][VehicleOffsetData] = {
    { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, true },
    { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, true },
    { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, false }
};

stock GetOffSetIndex(modelid) { return modelid - 400; }
}
Now when they get in the vehicle do something like

Код:
new offindex = GetOffSetIndex(GetVehicleModel(p));
if(vOffSets[offindex][vUseOffset])
{
      obj[playerid] = CreatePlayerObject(playerid,19300, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100);
      AttachPlayerObjectToVehicle(playerid,obj[playerid],p,
             vOffSets[offindex][vOffX],
             vOffSets[offindex][vOffY],
             vOffSets[offindex][vOffZ],
             vOffSets[offindex][vOffRX],
             vOffSets[offindex][vOffRY],
             vOffSets[offindex][vOffRZ]);

}
It's not going to work for every vehicle as well that is the reason for checking if a vehicle can use offsets you probably won't use the rotation offsets but i'm guessing they could be useful.

Additionally you could also expand that array to include offsets for each seat in the vehicle. I hope all these helps BTW you did rip this script off from here https://sampforum.blast.hk/showthread.php?tid=324233 so you should give the guy some credit.

His Script -> obj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);
Your Script ->obj[playerid] = CreatePlayerObject(playerid,19300, 0.0000, -1282.9984, 10.1493, 0.0000, -1, -1, 100);

Same useless nonsensical offsets.
Reply
#4

Lol ok I hadnt known that someone did it before I gonna add him in the credits aswell then but however your idea about the different offsets is nice and i definetly going to upgrade it with it.
Next thing is that i made an firstpersoncam for Onfoot aswell heres a prealpha version of it:
Код:
//   1st Person Cam By Redreaper666 || V0.5beta

//INLUDES + DEFINES
#include <a_samp>
#include <zcmd>

new pObject[MAX_PLAYERS];

CMD:camon(playerid)
{
SetTimer("UpdateCam",10,1);//Use a streamer instead
return 1;
}
CMD:camoff(playerid)
{
DestroyPlayerObject(playerid, pObject[playerid]);
SetCameraBehindPlayer(playerid);
for(new i=0; i<MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
RemovePlayerAttachedObject(playerid, i);
}
return 1;
}

forward UpdateCam(playerid);
public UpdateCam(playerid)
{
DestroyPlayerObject(playerid, pObject[playerid]);
new Float:X, Float:Y, Float:Z;//Float:ANGLE;//only for Settimer("..",100,1);
GetPlayerPos(playerid,X,Y,Z);
//GetPlayerFacingAngle(playerid,ANGLE);//only for Settimer("..",100);
pObject[playerid] = CreatePlayerObject(playerid, 19300, X-0.05, Y, Z+0.65, 0.0, 0, 0.0);
SetPlayerAttachedObject(playerid, 3, pObject[playerid], 2, 0.101, -0.0, 0.0, 5.50, 84.60, 83.7, 1, 1, 1);
AttachCameraToPlayerObject(playerid,pObject[playerid]);
//SetPlayerFacingAngle(playerid,ANGLE);//only for Settimer("..",100,1);
return 1;
I would like you to test it out
Reply
#5

Very nice
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)