SA-MP Forums Archive
camera "float" < help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: camera "float" < help! (/showthread.php?tid=91867)



camera "float" < help! - Daem - 17.08.2009

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", 50, 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 to change the 'camera look at' in front of the vehicle?


Re: floats... help - Daem - 17.08.2009

bump


Re: floats... help - Joe Staff - 17.08.2009

You're using a timer that will cause your camera to change positions 200 times a second. You will get a major dosage of lag at that rate. I wouldn't even suggest you use that function in OnPlayerUpdate because in either case, it's going to look horrible in-game.


Re: floats... help - Daem - 17.08.2009

ye... that doesn't help me...


Re: floats... help - Daem - 18.08.2009

*BUMP*


Re: camera "float" < help! - Daem - 18.08.2009

this topic in page 3!
why no one reply's? i mean 60 views and no one reply useful reply? is that so hard?


Re: floats... help - Andom - 18.08.2009

Quote:
Originally Posted by Joe Staff
You're using a timer that will cause your camera to change positions 200 times a second. You will get a major dosage of lag at that rate. I wouldn't even suggest you use that function in OnPlayerUpdate because in either case, it's going to look horrible in-game.



Re: camera "float" < help! - Daem - 18.08.2009

Quote:
Originally Posted by Daem
ye... that doesn't help me...