Camera moves smoothly to the request class place
#1

New 0.3e function interpolatecamerapos and interpolatecameralookat are nice and usefull. But if you add them instead of old SetCameraPos and SetCameraLookAt in OnPlayerRequestClass camera moves from one place to another each time you switch class, but many people want camera to move to request class place one time and not to move when you choose class. I found a decicion:

PHP код:
new isreq[MAX_PLAYERS];
forward isreqtimer(playerid);
public 
OnPlayerRequestClass(playeridclassid)
{
    if(
isreq[playerid] == 0)
    {
    
InterpolateCameraPos(playerid2362.0256, -2658.9897101.20322108.0005, -2411.199716.31321500CAMERA_MOVE);
    
InterpolateCameraLookAt(playerid2042.0256, -2595.989760.20322107.0256, -2410.989716.20322000CAMERA_MOVE);
    
isreq[playerid] = 1;
    }
    return 
1;
}
public 
OnPlayerRequestSpawn(playerid)
{
    
isreq[playerid] = 0;
        return 
1;

So unless the value of "isreq" is 0 camera interpolates at OnPlayerRequestClass, and just when onplayerrequestclass is called the first time camera "flies" to request class place and at the next moment value of "isreq" changes to 1; and camera doesn't move anymore. But this doesn't always work correctly. Soemtimes camera stops before arriving to the needed place, so i want to know, if there are any other ways to do that. Sorry for my english
Reply


Messages In This Thread
Camera moves smoothly to the request class place - by pasha97 - 13.05.2012, 14:18

Forum Jump:


Users browsing this thread: 2 Guest(s)