28.06.2012, 01:43
Is it possible so somehow limit the player camera view angles? I'm making a first person view system and I don't want the player to have to move the mouse every time he/she turns.
Also, when I attach the player camera to the object, I get really messed up co-ordinates of usually a back seat location.
Also, when I attach the player camera to the object, I get really messed up co-ordinates of usually a back seat location.
pawn Код:
if(newstate == PLAYER_STATE_PASSENGER)
{
new vehmod=GetVehicleModel(GetPlayerVehicleID(playerid));
new vehicleid=GetPlayerVehicleID(playerid);
//new seat=GetPlayerVehicleSeat(playerid);
if(vehmod != 556) // Insert various checks here
{
new Float:x, Float:y, Float:z;
GetVehicleModelInfo(vehmod, VEHICLE_MODEL_INFO_REARSEAT, x,y,z);
PlayerCam[playerid] = CreateObject(19254,x,y,z,0.0,0.0,0.0,200.0);
AttachObjectToVehicle( PlayerCam[playerid], vehicleid, x,y,z, 0, 0, 0);
AttachCameraToObject(playerid, PlayerCam[playerid]);
}
}
if(oldstate == PLAYER_STATE_PASSENGER)
{
if(PlayerCam[playerid] != -1)
{
SetCameraBehindPlayer( playerid );
DestroyObject(PlayerCam[playerid]);
PlayerCam[playerid] = -1;
}
}
if(oldstate == PLAYER_STATE_DRIVER)
{
if(PlayerCam[playerid] != -1)
{
SetCameraBehindPlayer( playerid );
DestroyObject(PlayerCam[playerid]);
PlayerCam[playerid] = -1;
}
}
if(newstate == PLAYER_STATE_DRIVER)
{
new vehmod=GetVehicleModel(GetPlayerVehicleID(playerid));
new vehicleid=GetPlayerVehicleID(playerid);
if(vehmod != 556) // Insert various checks here
{
new Float:x, Float:y, Float:z;
GetVehicleModelInfo(vehmod, VEHICLE_MODEL_INFO_FRONTSEAT, x,y,z);
PlayerCam[playerid] = CreateObject(19254,x,y,z,0.0,0.0,0.0,200.0);
AttachObjectToVehicle( PlayerCam[playerid], vehicleid, x,y,z, 0, 0, 0);
AttachCameraToObject(playerid, PlayerCam[playerid]);
}
}