Régen fent volt a hivatalos fórumon, bemásolom neked:
#define player_x 0.0
#define player_y 0.0
#define player_z 0.0
#define player_angle 0.0
#define camera_x 0.0
#define camera_y 0.0
#define camera_z 0.0
#define moving_speed 50
enum pInfo
{
Float:SpawnAngle,
SpawnTimer,
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Amikor a karaktere skint választ, illeszd be oda:
SetPlayerPos(playerid, player_x,player_y,player_z);
SetPlayerFacingAngle(playerid, player_angle);
SetPlayerCameraPos(playerid, camera_x,camera_y,camera_z);
SetPlayerCameraLookAt(playerid, player_x,player_y,player_z);
PlayerInfo[playerid][spawnTimer] = SetTimerEx(\"MoveCamera\", moving_speed, true, \"i\", playerid);
forward MoveCamera(playerid);
public MoveCamera(playerid)
{
SetPlayerCameraPos(playerid, player_x - 2 * floatsin(-PlayerInfo[playerid][spawnAngle], degrees), player_y - 10 * floatcos(-PlayerInfo[playerid][spawnAngle], degrees), player_z + 3);
SetPlayerCameraLookAt(playerid, player_x, player_y, player_z + 0.5);
PlayerInfo[playerid][spawnAngle] += 0.5;
if(PlayerInfo[playerid][spawnAngle] >= 360.0)
PlayerInfo[playerid][spawnAngle] = 0.0;
}
És, ha kiválasztotta a skinjét, ezzel hagyod abba:
PlayerInfo[playerid][spawnAngle] = 0.0;
KillTimer(PlayerInfo[playerid][spawnTimer]);
SetCameraBehindPlayer(playerid);