27.01.2013, 13:13
In my server, when player connects and starts selectiong skin, hic camera moves slowly to the place of selecting. But it doesn't always work propertly. Sometimes camera stops on a half of a way. Here is a code:
pawn Код:
new is1st[MAX_PLAYERS];
public OnPlayerRequestClass(playerid, classid)
{
if(IsPlayerNPC(playerid)) return SpawnPlayer(playerid);
TextDrawShowForPlayer(playerid,Text:Box);
TextDrawShowForPlayer(playerid,Text:Box2);
if(is1st[playerid]==0)
{
InterpolateCameraPos(playerid, 2030.1234,1567.5530,29.6463, 2008.1212,1664.7034,14.2188, 5000, CAMERA_MOVE);
InterpolateCameraLookAt(playerid, 2028.5165,1553.5148,30.8905, 2005.2192,1669.0897,12.7685, 5000, CAMERA_MOVE);
is1st[playerid]=1;
}
SetPlayerPos(playerid, 2005.2192,1669.0897,12.7685);
SetPlayerFacingAngle(playerid, 228.7617);
SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DANCE3);
CreateExplosion(2005.2192,1669.0897,12.7685, 11, 2.0);
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
is1st[playerid]=0;
return 1;
}
public OnPlayerConnect(playerid)
{
is1st[playerid]=0;
return 1;
}