19.10.2011, 20:20
mi duda esta ves (otra) es sobre como poner al logearse una camara en movimiento
// Arriba de todo
#define Pos_x 2178.4922
#define Pos_y 1285.8121
#define Pos_z 42.2499
#define Pos_angle 270.0764
#define camara_x 2961.4202
#define camara_y -1875.7118
#define camara_z 9.7813
#define Velocidad 50
forward SetupPlayerForClassSelection(playerid);
forward MoverCamara(playerid);
enum Info
{
Float:SpawnAngle,
bool:SpawnRotate,
SpawnTimer,
};
new PlayerInfo[MAX_PLAYERS][Info];
// En OnPlayerRequestClass
SetupPlayerForClassSelection(playerid);
// En OnPlayerConnect Agregas
PlayerInfo[playerid][SpawnRotate] = true;
// Ahi agregas esta callback
public SetupPlayerForClassSelection(playerid)
{
SetPlayerPos(playerid, Pos_x,Pos_y,Pos_z);
SetPlayerCameraPos(playerid, camara_x,camara_y,camara_z);
SetPlayerCameraLookAt(playerid, Pos_x,Pos_y,Pos_z);
if (PlayerInfo[playerid][SpawnRotate]) PlayerInfo[playerid][SpawnTimer] = SetTimerEx("MoverCamara", Velocidad, true, "i", playerid);
PlayerInfo[playerid][SpawnRotate] = false;
return 1;
}
// Y otra callback
public MoverCamara(playerid)
{
SetPlayerCameraPos(playerid, Pos_x - 2 * floatsin(-PlayerInfo[playerid][SpawnAngle], degrees), Pos_y - 10 * floatcos(-PlayerInfo[playerid][SpawnAngle], degrees), Pos_z + 3);
SetPlayerCameraLookAt(playerid, Pos_x, Pos_y, Pos_z + 0.5);
PlayerInfo[playerid][SpawnAngle] += 0.5;
if (PlayerInfo[playerid][SpawnAngle] >= 360.0)
PlayerInfo[playerid][SpawnAngle] = 0.0;
return 1;
}
// A OnPlayerSpawn Agregas
PlayerInfo[playerid][SpawnAngle] = 0.0;
KillTimer(PlayerInfo[playerid][SpawnTimer]);