SetPlayerCameraLookAt
#1

pawn Код:
new Text:Textdraw1;
new cam[MAX_PLAYERS];
forward CamWithPlane(playerid, vehicleid);
public OnGameModeInit()
{
Textdraw1 = TextDrawCreate(292.000000,186.000000," I~n~- -~n~ I");
/* this look like:
 I
- -
 I
(target)
*/

//more of those codes....
return 1;
}

public OnGameModeExit()
{
TextDrawDestroy(Textdraw1);
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
TextDrawHideForPlayer(playerid, Textdraw1);
return 1;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(GetVehicleModel(vehicleid) == 476) //rustler
    {
    TextDrawShowForPlayer(playerid, Textdraw1);
    cam[playerid] = SetTimerEx("CamWithPlane", 10, true, "ii", playerid, vehicleid);
    }
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
  if(GetVehicleModel(vehicleid) == 476) //rustler
    {
    TextDrawHideForPlayer(playerid, Textdraw1);
    KillTimer(cam[playerid]);
    }
    return 1;
}

public CamWithPlane(playerid, vehicleid)
{
new Float:lol[3];
GetVehiclePos(vehicleid, lol[0], lol[1], lol[2]);
SetPlayerCameraPos(playerid, lol[0], lol[1], lol[2]);
//what now? (floats)
SetPlayerCameraLookAt(playerid, >>?<<);
}
how can i change the 'camera look at' in front of the vehicle?
Reply
#2

You asked the same thing yesterday: http://forum.sa-mp.com/index.php?topic=116758.0

Why creating a new topic for the same thing?

And if you want to look in front of the car, you need to use GetVehicleZAngle, floatsin and floatcos.
Reply
#3

Yes i created it again because its in page 4 or 3 and no one read it any more
Quote:
Originally Posted by paytas
you need to use GetVehicleZAngle, floatsin and floatcos.
example please, dunno "float.inc" functions
Reply
#4

http://en.wikipedia.org/wiki/Trigonometry
Reply
#5

Quote:
Originally Posted by paytas
sin X
cos - Y
? - Z
Reply
#6

You mean that I can make a cameralook if you are in a vehicle that you see the dashboard etc.?
Reply
#7

Yes almost every thing is possible to script
Reply
#8

Quote:
Originally Posted by Daem
Yes almost every thing is possible to script
you're very wrong, many things are impossible to script with samp. For example, your camera thing: its impossible to make it works correctly coz there isnt GetVehiclePitch function.
Reply
#9

Yes I want that there is a: if VehicleExist(vehicleid);

And how could you know where the camerapos is because I want to do if you are the driver that you look at what the driver should see.
Reply
#10

Quote:
Originally Posted by paytas
Quote:
Originally Posted by Daem
Yes almost every thing is possible to script
you're very wrong, many things are impossible to script with samp. For example, your camera thing: its impossible to make it works correctly coz there isnt GetVehiclePitch function.
god damn, so you're telling me to delete that?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)